Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Check if a String is a valid Double the easy way...?

807588Jun 3 2009 — edited Jun 4 2009
Hi,

How can I check that the String value is a valid Double value in an easy way ?

Ofcourse I try/catch the method call Double.parseDouble(value), but I always understood that throwing an exception is expensive.

I want to do it the cheap way as I do it during every keystroke :(... (validation of key input).

The implementation of this method is hidden in the sun package so that doesn't really help a lot :(.

Cheers,
Ed
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2009
Added on Jun 3 2009
17 comments
882 views