The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


StringTokenizer is the way to go

Posted by Johny John on November 26, 2001 at 9:57 PM

> > > I have a line of input from the user of integers, char's, etc in which each character is separated by a space. is there an easy way to parse the data and put it into a stack?

> I believe theres a class in java called StringTokenizer It will take and seperate a string into several strings (accessed by meathods) seperated by some delm (default is space)
> I think that it would do what you want?

The StringTokenizer is the best way to go as it would divide the
string according to words with spaces as delimiters.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us