String Methods


charAt()
length()

Goal:

Use charAt and length methods to access information in a String variable.

Steps:

  1. Create a String variable and initialize it with some characters (at least 3).
  2. Use the charAt method to print the 3rd character in the String (remember, computers start counting at zero).
  3. Use the length method to print how many characters are in the String.
  4. Use a for loop to examine each character in the String, and when you find one that matches the character you are looking for, print its index.