469,314 Members | 2,182 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,314 developers. It's quick & easy.

To find number of character without space using java

1
To find number of character without space using java

Example:
String = prabu sun
No. of char =8

plz send me code
Jul 2 '07 #1
3 3918
r035198x
13,262 8TB
To find number of character without space using java

Example:
String = prabu sun
No. of char =8

plz send me code
No one is going to write it for you.
Read the java docs and see the methods in the String and Character classes.
Jul 2 '07 #2
JosAH
11,448 Expert 8TB
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.

kind regards,

Jos
Jul 2 '07 #3
praveen2gupta
201 100+
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.
Jul 3 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Christian Roth | last post: by
4 posts views Thread by Vig | last post: by
2 posts views Thread by colinhumber | last post: by
44 posts views Thread by Kulgan | last post: by
14 posts views Thread by inpuarg | last post: by
2 posts views Thread by karinmorena | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.