![]() ![]() Index numbers are assigned starting from 0 and increase for every new character in a string, including spaces, letters, numbers, and symbols.Īn StringIndexOutOfBoundsException is raised if you specify an index value that is greater than the length of the string with which you are working. This means that you can retrieve individual characters from a particular string.įor instance, you can retrieve the first character in a string by referencing its Java index number, which is always 0. By default, the end value is equal to the length of a string.
0 Comments
Leave a Reply. |