How to measure the length of a String var? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 3

How to measure the length of a String var?

I have a string variable and I want to get its length, how?

2nd Sep 2017, 2:09 PM
Robert Sokolov
Robert Sokolov - avatar
1 Antwort
+ 4
using length() method within the String class String name = "Robby"; int length = name.length(); some more explanation: https://www.tutorialspoint.com/java/java_string_length.htm
2nd Sep 2017, 2:13 PM
Kyrizu
Kyrizu - avatar