Skip Top Navigation Bar

AP CSA Student Practice

Review Videos

Check out the AP CSA review video series.

Strings

For the AP Exam, you will need to use the following methods:

Use the following examples to learn and practice creating String objects and using each of these methods.

Creating and Assigning Simple Strings of Characters

Getting the Length of a String with the length() Method

Getting a Substring from a String and an Index with substring()

Finding the Index of a String in Another String with indexOf()

Comparing Strings with == and equals()

Using compareTo() to Get the Rank of a Name in Alphabetical Order

Splitting a String of Characters with split()