Turn Desktop View Off
by Dinesh Thakur

 

public class NonBlankCharacters

{
            public static void main(String args[] )
            {
             StringBuffer NonBlank = new StringBuffer("Dinesh Thakur is a Columinist and Designer");
                        int Characters = 0;
                        for (int i = 0; i < NonBlank.length(); i++)
                        {
                                    if (NonBlank.charAt(i) == ' ')
                                                continue;
                                    Characters++;
                        }
                        System.out.println("Number of Non Blank Characters are :"+Characters);
                 }
}

Number of Non Blank Characters in a String