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. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.