Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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: 286
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
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
That's what the String.substring methods do.
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 286
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 ]
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: How to break a long String into small parts?