File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating an array from part of a string

 
Richard Shelly
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Richard Shelly
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic