I think you want to increment "countChar "instead of "count" in this statement
if(Character.isWhitespace(NB.charAt(i)))
{
++count;
}
:)
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
int countChar = string.replaceAll("\\s*", "").length();
Just to be an @ss! ;-)
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494