Answers for "java check if string is a double"

1

how to check if string is double or not in java

String decimalPattern = "([0-9]*)\\.([0-9]*)";  
String number="20.00";  
boolean match = Pattern.matches(decimalPattern, number);
System.out.println(match); //if true then decimal else not
Posted by: Guest on October-01-2021

Code answers related to "java check if string is a double"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language