StringTokenizer
How does one make a new Stringtokenizer with delimiters...
I know that the docs say new Stringtokenizer(String s, delimiters) but there's no real specification on exactly how..... for example when I did this:
Stringtokenizer(ThisString, "+=;-") it freaked out and just elimated everything...so I'm not sure what the correct syntax is....I thought of using Streamtokenizer...I believe it is...but its more than I need...this will work just fine if I can get the delimiters enter right...I need the space, a semi colon, a comma, and a hash as delimiters....
Thanks in advance....
[604 byte] By [
verbitya] at [2007-11-27 3:39:22]

ok this is what I did: StringTokenizer str = new StringTokenizer(s.toLowerCase(), ".,-;");and at this line:token = str.nextToken();I get a nosuchelementException
> ok this is what I did:
>> StringTokenizer str = new StringTokenizer(s.toLowerCase(), ".,-;");
>
> and at this line:
>> token = str.nextToken();
>
> I get a nosuchelementException
That's a different issue.
Did you properly call str.hasMoreElements() first to make certain that there were any elements left?
a sample code for demonstrating the use of StringTokenizerStringTokenizer st = new StringTokenizer(parts[0],":");while (st.hasMoreTokens()) { System.out.println(st.nextToken());}paste ur code, lets see what r u trying to achieve?