Register to reply

Java Question

by G01
Tags: java
Share this thread:
G01
#1
Feb13-06, 08:57 PM
HW Helper
G01's Avatar
P: 2,688
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?
Phys.Org News Partner Science news on Phys.org
Climate change increases risk of crop slowdown in next 20 years
Researcher part of team studying ways to better predict intensity of hurricanes
New molecule puts scientists a step closer to understanding hydrogen storage
chroot
#2
Feb13-06, 09:01 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
"Read a string?" From standard input?

Use e.g.

String s = System.in.readLine();
int n = s.length();

- Warren
G01
#3
Feb14-06, 10:15 PM
HW Helper
G01's Avatar
P: 2,688
Thanks alot.


Register to reply

Related Discussions
JLabel java question. Engineering, Comp Sci, & Technology Homework 1
A question about binary tree(java) Programming & Computer Science 2
Question about this java program Programming & Computer Science 6
Java Question Programming & Computer Science 2
Java question Programming & Computer Science 5