+ 1
How to use "lenght" on Scanner?
3 Answers
+ 2
but this way you lost scanned line and you get only its length
+ 7
Scanner sc = new Scanner(System.in);
int stringLength = sc.nextLine().length();
System.out.print(stringLength);
+ 2
Can you explain your idea? I don't understand where you're going with that code : )