/* 
*  This program illustrates the use of some String methods
*
* @ author Elizabeth Adams
*
*
*/
import java.util.Scanner;
public class Quiz2bKEY
{
   public static void main (String [] args)
	{
	   String code;
		char temp;
		Scanner scan;
		scan = new Scanner(System.in);
		
		System.out.println (" Please enter a string and hit return ");
		code = scan.nextLine();
		
		System.out.println (" The string you entered is : " + code);

		System.out.println (code.length());
      System.out.println (code.charAt(13));
      System.out.println (code.substring(18,20));
    
	 try
	 {

		System.out.println (code.charAt(50));
	 }
	 catch (StringIndexOutOfBoundsException  sioobe)
	 {
	   System.out.println (" index 50 doesn't exist" );
	 }		
	 if (code.charAt(5) == 'A')
		   System.out.println ( "found an A at index 5"  );
	 else
		   System.out.println (" character at index 5 wasn't an A" );
	}
}
	

