What is the method of String for getting the length?
How to get length of string in Java?
Tell me code fast.
Thanks
Hi,
You may use the following code:
String str= "Good Tutorials"; int length = str.length();
You have to use the str.length() to get the length of a String object.
Thanks
Ads