Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Tutorial Basic Detail
Total Hits: 8177
Total Votes: 153 votes
Average Rating: 3.83 out of 5
Category: JAVA/Core JAVA
Description:The length of the string is easy to define , it is the number of characters in the string including white spaces .
Java make the things easy as it provides the built in length method for the String class (java.lang.String) which is a final class .
for example :
String demo = " This is java built in method example "
int length= demo.length();
But what happens , if we don't want to use the java built in method to calculate the length of the string .
Then there is also a way to calculate the length of the string