📜  如何在java代码示例中检查字符串是否为双精度

📅  最后修改于: 2022-03-11 14:52:18.284000             🧑  作者: Mango

代码示例1
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