title: how to count the spaces in a java string?
body: <p>I need to count the number of spaces in my string but my code gives me a wrong number when i run it, what is wrong?</p>
  
  <pre><code> int count=0;
      String arr[]=s.split("\t");
      OOPHelper.println("Number of spaces are: "+arr.length);
      count++;
  </code></pre>