EN
Java - how to check string length?
0
points
In Java it is possible to check string length in following way.
1. String length() method example
public class StringExample {
public static void main(String[] args) {
String text = "This is my text...";
String anotherText = "Another text...";
System.out.println(text.length()); // 18
System.out.println(anotherText.length()); // 15
}
}
Output:
18
15