Lesson 4.1 · College Board Unit 1
String Indexing
A String of length n has valid character indices 0 through n - 1. Use substring(i, i + 1) to obtain a one-character String.
Code Scholars Tutoring · AP Computer Science A
Text as an immutable object. Two facts generate most of the unit: indexing starts at zero and stops one before the length, and no String method ever changes the String it was called on.
Lesson 4.1 · College Board Unit 1
A String of length n has valid character indices 0 through n - 1. Use substring(i, i + 1) to obtain a one-character String.
Lesson 4.2 · College Board Unit 1
substring includes its start index and excludes its end index. indexOf returns the first matching index, or -1 when there is no match.
Lesson 4.3 · College Board Unit 1
String methods return values without changing the original object. Assign the result when a transformation should replace a variable's current value.
Lesson 4.4 · College Board Unit 1
Traverse indices less than length, extract each one-character substring, and use equals for content comparison.
Work through questions with a tutor and get help with the steps you find difficult.
Get help with this topic