/*
   Program to test out some String methods in Chapter 2
   File: Ch2TestString.java
*/

class Ch2TestString {

   public static void main (String[] args) {
      
      String text = "I'm studying CS1101.";
      // or String text = new String("I'm studying CS1101.");
      // We'll explain the difference next time.

      System.out.println("text: " + text);

      int length = text.length();
      System.out.println("text.length(): " + length);

      System.out.println("text.substring(5,8): " +
                         text.substring(5,8));

      System.out.println("text.indexOf(\"in\"): " + 
                         text.indexOf("in"));

      // why are there 2 backslashes (\) above?

      String newText = text + "How about you?";
      System.out.println("newText: " + newText);
   }
}


