× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



TAllen@xxxxxxxxxxxx skrev:
Sep 29, 2009 7:00 PM GMT+00:00 Sep 30, 2009 7:30 PM GMT+00:00

I am using "GMT+00:00" (no quotes) as the delimiter.

The String#split method correctly splits the string in to the array
elements using a simple regex:
String[] tokens = text.split("GMT\\+00:00");

The StringTokenizer splits on the first double zero in 2009 and then stops
at the colon in the time next:
StringTokenizer t = new StringTokenizer(text, "GMT+00:00");

The 1st two tokens are:
Sep 29, 2
9 7

Has anyone seen this behavior before? Am I missing something obvious?
StringTokenizer works on characters - not strings.

What you say, is that the characters G, M, T, +, 0 and : are delimiters between tokens, so the first token is from the beginning of the string and up to the first zero (and multiple delimiters are ignored as standard so the second zero is skipped) and then you get the "9 7" up to the colon.

Making sense?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.