Length of string without using java built in function
Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Total Hits: 10473
Total Votes: 162 votes
Category: JAVA/Core JAVA
Submitted on: 2013-11-22 12:44:14
Submitted By: Java Hungry
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 More detail...