aspose file tools*
The moose likes Beginning Java and the fly likes How to break  a long String into small parts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to break  a long String into small parts?" Watch "How to break  a long String into small parts?" New topic
Author

How to break a long String into small parts?

raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
Hi
Is there any method in the Java 1.5 API ,with which i can break a long string into small strings by specifying the length of smaller string.
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
That's what the String.substring methods do.


Ping & DNS - updated with new look and Ping home screen widget
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
Thanks Ulf.
Piet Verdriet
Ranch Hand

Joined: Feb 25, 2006
Posts: 266
Or you could use String.split(...), which immediately returns an array of Strings.
[ October 09, 2008: Message edited by: Piet Verdriet ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to break a long String into small parts?
 
Similar Threads
Problems making an unique ID for every word
Parameter value
Line break
Passed.. oopppsss i did it again 149/155
inserting line break in <h:outputText> value