Java Question

  • Java
  • Thread starter G01
  • Start date
  • #1
G01
Homework Helper
Gold Member
2,696
17
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?
 

Answers and Replies

  • #2
chroot
Staff Emeritus
Science Advisor
Gold Member
10,275
40
"Read a string?" From standard input?

Use e.g.

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

- Warren
 
  • #3
G01
Homework Helper
Gold Member
2,696
17
Thanks alot.
 

Suggested for: Java Question

Replies
2
Views
343
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
803
Replies
4
Views
423
  • Last Post
Replies
1
Views
862
Replies
1
Views
658
Replies
4
Views
468
Replies
14
Views
1K
  • Last Post
Replies
19
Views
1K
Top