This discussion is archived
5 Replies Latest reply: Jan 13, 2009 12:38 PM by thomas.behr RSS

Parsing a String - identifying position

800467 Newbie
Currently Being Moderated
Hi all,

I have a line in my csv file which has 5 columns (as below)...Is there a way of identifying that green is in the 3rd column of this line, I looked at StringTokenizer but from what I can see its not possible to do this without calling nextToken() e.g. 3 times...

Example of input:
String color = "blue, red, green, orange, white";
I need to be able to get the position of "green",

Is there a good way of doing this?

Thanks,