title: StringIndexOutOfBound Exception
body: <p>I am new to programming and I was tryng to write a program which takes a string from the user and tells the number of lowercase, upper case, white spaces etc in the string to the user. But I get an error which says, "StringIndexOutOfBound. Please tell me what mistake I made here?. Thanks</p>
  
  <pre><code>public class CharacterCount {
      public static void main(String args[])throws Exception{
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("Please enter you string here");
          String s = br.readLine();
          System.out.println(s);
  
          int upperCase = 0;
          int lowerCase = 0;
          int specialCase = 0;
          int whiteSpace = 0;
          int number = 0;
  
          for(int i=1;i&lt;=s.length();i++)
          {
              char ch = s.charAt(i);
              if(Character.isAlphabetic(ch))
              {
                  if(Character.isUpperCase(ch))
                  {
                      upperCase++;
                  }
                  else
                  {
                      lowerCase++;
                  }
              }
  
              if(Character.isWhitespace(ch))
              {
                  whiteSpace++;
              }
              if(Character.isDigit(ch))
              {
                  number++;
              }
              else
              {
                  specialCase++;
              }
          }
  
          System.out.println("-----------------------------------------------------------------");
          System.out.println("The following are the results:");
          System.out.println("-----------------------------------------------------------------");
          System.out.println(lowerCase+" :Lower Case Characters");
          System.out.println("-----------------------------------------------------------------");
          System.out.println(upperCase+" :Upper Case Characters");
          System.out.println("-----------------------------------------------------------------");
          System.out.println(whiteSpace+" :White Space");
          System.out.println("-----------------------------------------------------------------");
          System.out.println(specialCase+" :Special Characters");
          System.out.println("-----------------------------------------------------------------");
          System.out.println(number+" :Digits");
          System.out.println("-----------------------------------------------------------------");
          System.out.println("----------------************THE END************------------------");
          System.out.println("-----------------------------------------------------------------");
  
      }
  }
  </code></pre>