Substrings, Characters
-
A portion of a string.
-
substring(beginIndex, endIndex) where
-
beginIndex is the first character of the desired substring,
-
endIndex is the last character, non-inclusive.
-
the first character in a string is index 0.
-
Yes, it is confusing, and it is the same way in Java.
-
Get a single character: charAt(position)
-
Find a substring: indexOf(string), indexOf (string, startPosition)
where
-
string is the substring you want to find in the string.
-
startPosition is the position from which you want to start searching.
String Arrays
Home
Internet II: Day 2