Length of string without using java built in function

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Length of string without using java built in function

The length of the string is easy to define for example But what happens if we dont want to use the java built in method
http://javahungry.blogspot.com/2013/06/find-length-of-string-calculate-without-using-built...
  • Total Hits: 8944

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 154 votes

  • Category: JAVA/Core JAVA

  • Submitted on: 2013-11-22 12:44:14

  • Submitted By: Java Hungry

  • Set as Favorite

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...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.96%  60
 Two starsTwo star  Vote LeftVote MiddleVote Right 9.09%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.04%  17
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.39%  16
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 30.52%  47

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.






Advertisements