title: Handle StringIndexOutOfBoundsException for string
body: <pre><code>try {
      string = scan.nextLine().charAt(0);
  } catch(StringIndexOutOfBoundsException siobe){
      System.out.println("invalid input");
  }
  </code></pre>
  
  <p>I am trying to use this code for handling exception for the string that i am getting from a text file. But i get an error saying try to change the actual string declaration to character. I am not sure how to handle this ?</p>