Hi, I posted something about checking strings previously, but I have a different question now. How do you check a string for the number of occurences of a particular character? I want to see if a character occurs more than once or twice. TIA. kevin
char a = yourCharacter for(int i =0; i < yourString.length(); ++i){ if(a == yourString.charAt(i)) ++numberOfOccurences } ------------------ Bosun SCJP for the Java� 2 Platform
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley