check if a string is a number


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. try {
  2. Double.parseDouble(yourString);
  3. } catch (NumberFormatException e) {
  4. // yourString ain't 10.6, that's for sure
  5. }

URL: http://forum.java.sun.com/thread.jspa?threadID=586718&messageID=3024348

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.