File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes length of the string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 18541
    
    8

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: 4339
    
    7

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

(Locking this thread)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: length of the string
 
Similar Threads
maximum length of String = 32k ?
amount of digits entered(without a tokenizer)....
NumberFormatException using line.substring
String.length() returns strange results
StringOutOfBoundsException