+ 6
How can you refer to a char of a string.
well I know the endsWith and starts with method . but is there any other method .
5 Answers
+ 3
.charAt gives you the chart at a certain position
.indexOf returns the first position a particular character is found.
You can look all this up. Google for java SE API.
+ 15
Use stringVar.charAt(index) to get any one character as a char. The index works like that for an array, so start at 0.
Or, use stringVar.substring(index, index + 1) to get a single character as a string.
+ 7
thanks
+ 7
.charAt(<index>)
+ 3
string.charAt(index)
or
string.subString(startIndex, endIndex)