the regular expression package that Barry mentioned is only available with the latest JDK version -- 1.4.
This means that in your code, you are only using a space character as a delimiter. Using your example of '2003-1-2', you would be able to parse it by invoking the following:
public StringTokenizer(String str)Constructs a string tokenizer for the specified string. The tokenizer uses the default delimiter set, which is " \t\n\r\f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character. Delimiter characters themselves will not be treated as tokens.
Originally posted by Maulin Vasavada:
i mean reg exp and all would be too much work for nothing...