String regex = "^[0-9]+$";
String str = "12"
if(str.matches(regex))
System.out.println("Number")
To see this working, head to your live site.
Search
Jul 20, 2019
Java Program to Check if a String is Numeric
Java Program to Check if a String is Numeric
0 comments
0