- /**
- * 使用java正则表达式去掉多余的.与0
- * @param s
- * @return
- */
- public static String format(String s){
- if(s.indexOf(".") > 0){
- s = s.replaceAll("0+?$", "");//去掉多余的0
- s = s.replaceAll("[.]$", "");//如最后一位是.则去掉
- }
- return s;
- }
使用java正则表达式去掉多余的.与0
最新推荐文章于 2023-05-12 16:34:09 发布