What is the correct way to find the length of text string?

Trung Minh

New member
What is the correct way to find the length of text string?
Answer
To calculate the length of a string in Java, you can use
an inbuilt length() method of the Java string class. In Java, strings are objects created using the string class and the length() method is a public member method of this class. So, any variable of type string can access this method using the . (dot) operator.
 

Tìm kiếm

Back
Top