Don’t go back to your old post and correct an error which has been pointed out to you. That makes Jeff’s reply look like nonsense.
You should use an indentation convention (one available here, which doesn’t make the serious error of saying you can use tabs) and follow it religiously. You can program it into Eclipse as a project property and then use ctrl‑A‑ctrl‑I to impose indentation.
But you ought not to use an IDE at all if you are a beginner.
Joined: Oct 13, 2005
Why are you using a counting method on Strings when the String class has lots of methods, one of which does exactly what you want. And faster.