Java Question

  • Java
  • Thread starter G01
  • Start date
  • #1
G01
Homework Helper
Gold Member
2,682
16
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,239
37
"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,682
16
Thanks alot.
 

Related Threads on Java Question

  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
5
Views
4K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
3
Views
2K
Replies
11
Views
2K
Replies
2
Views
1K
Replies
6
Views
691
  • Last Post
2
Replies
28
Views
2K
Top