Length of string without using java built in function
Tutorials Shared by the Internet Community
Total Hits - 32564
Total Votes - 144 votes
Vote Up - 60 votes
Vote Down - 84 votes
Domain - javahungry.blogspot.com
Category - JAVA/Core JAVA
Submitted By - Java Hungry
Submitted on - 2013-11-22 12:44:14
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 More detail...