Physics Forums
>
Other Sciences
>
Computing & Technology
>
Programming & Comp Sci
> Java Question
PDA
View Full Version :
Java Question
G01
Feb13-06, 09:57 PM
I need java to read a string and count how many characters are in it. I know theres some class that can do this. What is it?
chroot
Feb13-06, 10:01 PM
"Read a string?" From standard input?
Use e.g.
String s = System.in.readLine();
int n = s.length();
- Warren
G01
Feb14-06, 11:15 PM
Thanks alot.
vBulletin® v3.7.6, Copyright ©2000-2009, Jelsoft Enterprises Ltd.