How to count no. of tokens in a string?

hello everybody?

I am using StringToknizer to read a csv file line by line.

My problem is:

i want to know how many tokens are there in a particular row. How to count it at a streatch?

i am using

<%

if (st.hasMoreTokens())

{

a3=st.nextToken().trim();

}

%>

i thought of using String.split(), but, i don't know how to use it?(what class to import)

Anyguidence will be appreciated

Thanks for your time.

Regards,

Ashvini

[606 byte] By [Ashvinia] at [2007-10-2 5:12:25]
# 1
StringTokenizer will do it for you!int numberOfTokens = st.countTokens();m
yorkroada at 2007-7-16 1:15:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks Yorkroad,Thanks a lot.Regards,AShvini
Ashvinia at 2007-7-16 1:15:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...