posted 15 years ago
You can use another form of parse that will not throw an exception:
I have used this myself to make sure that there is no "clutter" after the valid string, e.g. "04-30-2009abc":
pos.getIndex() is guaranteed to not change if there is an error, so in this case it will remain 0.