Home page

Monday, June 11, 2018

Check value is decimal or not

public static boolean isDecimal(String str) {
Pattern p = Pattern.compile("[0-9]+(\\.[0-9][0-9]?)?");
return p.matcher(str).matches();
}

No comments:

Post a Comment