To find number of character without space using java
Example:
String = prabu sun
No. of char =8
plz send me code
You could turn it around: "find the number of spaces in a string". Counting all
characters in a String is solved already, i.e. the String class has a length() method.
To find number of character without space using java
Example:
String = prabu sun
No. of char =8
plz send me code
Hi
Do it as follows
1. declare a string variable.
2. assign the value to the variable.
3. use varable.length( ) to count the length. The space will be counted by this method.
Comment