title: string index out of bound exception, String index out of range
body: <p>So, I was writing a simple program to enter a string and count the total no. of m. 
  So, here's my code</p>
  
  <pre><code>for(int i=0; i&lt;=n; i++)
      {
          if((str.charAt(i)=='m'))
          {
          } else {
              count++;
          }
      }
      System.out.println("The total number of m is "+count);
  </code></pre>
  
  <p>where <code>n=str.length();</code>
  and str is a string which I had taken but there this error which keeps coming</p>
  
  <pre><code>Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 14
  at java.lang.String.charAt(String.java:646)
  at javaapplication.JavaApplication.main(JavaApplication.java:28
  Java Result: 1
  </code></pre>
  
  <p>what's this error and how to remove it?</p>