+ 3
Java Scanner Input Length
Hello everybody, can anyone tell me how to find the length of an Scanner Input? Because I want to do a program, which is printing out the length of the typed name. Sorry for my bad English because I am a german. https://code.sololearn.com/c5gn6J16jqZj/?ref=app
6 Respostas
+ 4
Strings have a length() method you can use.
Example/
String input = scannerName.nextLine();
input.length();
// this is the length of the String.
+ 4
And please ignore the test lines.
+ 3
Thanks for this! 😉
+ 3
@WebTop
I don't understand, you want to take the length of a number?
- 2
I do not know how to do this it says write a numner
- 2
sorry NUMBER