File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes String Tokens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "String Tokens" Watch "String Tokens" New topic

String Tokens

khizar dheen

Joined: May 30, 2007
Posts: 13
I added list of tokens in my list,after that i want to iterate the list,then i need to get that string tokens in my iterate.....any suggestion welcome...

I need to take that string token again..any suggestion
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

Welcome to JavaRanch.

Please UseCodeTags when you post source code. I've added them for you this time (I'm a moderator, so I can edit other user's posts).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

I'm not sure what you are asking. Are you saying you need the String [] token once you exit your for loop, or are you saying that after you iterate through the list (and print), you want to iterate again?

or are you asking something else?

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
khizar dheen

Joined: May 30, 2007
Posts: 13
Hi Fred,
This is my scenerio
I am a reading a file and separated as tokens,and then i added that tokens into list,now i need separated tokens in my list on iterate..

Here i am attaching my code..

[ UD: In the future, please UseCodeTags when posting code of an length. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so. ]
Aditya Kanitkar
Ranch Hand

Joined: Aug 08, 2009
Posts: 72
Now its looking neat....
Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
if you want to get the tokens from your list, you already did that:

do you mean an exception appeared?
Aditya Kanitkar
Ranch Hand

Joined: Aug 08, 2009
Posts: 72
Are you having the following pattern of contents in your file...???

If yes, then go ahead using this pattern...?? And explain your requirement....

If no , then put some sample data file of which you want to upload data....
I agree. Here's the link:
subject: String Tokens
It's not a secret anymore!