This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes length of the string Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

length of the string

s john smith
Greenhorn

Joined: Jan 12, 2012
Posts: 16

how to find the nuber of characters in the string without using length() or any standard library function?
Rod Singh
Greenhorn

Joined: Feb 10, 2012
Posts: 16
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

That works if you don't count toCharArray as a "standard library function". Which is fine with me, it's up to the question-setter to define what a "library function" is and how you tell whether it's "standard" or not.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Please UseOneThreadPerQuestion.(⇐click)

You've already been told it's not possible. If you don't like the answers you got, please discuss them in that thread, rather than starting a new one with the same question.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Rod Singh wrote:


How is String.toCharArray() not a "standard library function"?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3862
    
    1

Duplicate of http://www.coderanch.com/t/568433/java/java/find-number-characters-string

(Locking this thread)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: length of the string
 
Similar Threads
amount of digits entered(without a tokenizer)....
String.length() returns strange results
StringOutOfBoundsException
NumberFormatException using line.substring
maximum length of String = 32k ?