public static void main(String[] args) {
String str1 ="入账 -666.00";
String REGEX ="[^(0-9).]";
System.out.println(Pattern.compile(REGEX).matcher(str1).replaceAll("").trim());
}
JAVA只保留数字和小数点的方法
最新推荐文章于 2024-07-03 02:51:23 发布