to check for a numeric value in a string in java


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



Copy this code and paste it in your HTML
  1. java.util.regex.Pattern.matches("\\d*", (test==null)?"":test.trim())
  2.  
  3. returns a boolean

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.