wood burning stoves 2.0*
The moose likes Servlets and the fly likes converting String to an array 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 » Servlets
Bookmark "converting String to an array" Watch "converting String to an array" New topic
Author

converting String to an array

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
i have a string
parameter_name = invoice number, file name, userid
how do i convert this to an array, and use array index
to get each of three values separately


Bhasker Reddy
Kareem Gad
Ranch Hand

Joined: Aug 06, 2001
Posts: 89
you may want to consider using StringTokenizer class
check the javadoc for the methods of this class
------------------
KaReEm


<b><i>KaReEm</i><br /><ul type="square"><li>SCJP-Free Range Web Developer <br /></ul></b>
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

If you have a string like this:
String parameter_name = "546787,File21C,45";
Then use a StringTokenizer to break this into three different strings. Something like:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting String to an array