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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Creating an array from part of a string" Watch "Creating an array from part of a string" New topic
Author

Creating an array from part of a string

Richard Shelly
Greenhorn

Joined: Oct 03, 2005
Posts: 24
ok, so i have to line in a line of text from a file in the format of:
<integer>;<array of integers>;<string>

now, getting the int and String arent at all hard, but i am unsure how to fill an array with the numbers in the middle there.


<a href="http://www.somethingfm.net/" target="_blank" rel="nofollow">somthingFM</a> BOOYAH
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Have you checked out the String.split() method. It returns a String[] that you should be able to parse into an int[].
[ April 23, 2006: Message edited by: Garrett Rowe ]

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Richard Shelly
Greenhorn

Joined: Oct 03, 2005
Posts: 24
cheers man, but thankfully, ive already solved the problem, a couple of string tokenizers'.
thank though
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating an array from part of a string