Ask Question

What is the return value of "select". substring (4, 4) ?

+1
Answers (1)
  1. Today, 14:28
    0
    I'm assuming the syntax here is jа vascript:

    The str. substring () method takes in two integers - a start index and an end index - and returns all the characters in the specified range from the original string, including the character in the start index and excluding the character in the end index. jа vascript's is 0-indexed, which means that all of its indices start at 0.

    For instance, if we were to use the method on the string "test" and wanted to return the substring "tes", we'd call the following method:

    "test". substring (0,3)

    This would return everything from the first character, "t", up to but not including the fourth character, "t". The character immediately before the last "t" (index 3), "s" (index 2) would be our last character, and the console should print "tes" as a result.

    For your example, "select". substring (4,4) prints out every character starting at index 4 - the fifth character, "c" - up to but not including the character at index 4. We start and stop at the same character, so the method will only return the character "c", and nothing else.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the return value of "select". substring (4, 4) ? ...” in 📗 Mathematics if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers