优化字符串替换方法replaceAll替换为replace

This commit is contained in:
thinkgem
2019-08-22 12:52:51 +08:00
parent a7f80fd2c1
commit e7cfdf0d61
2 changed files with 4 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ public class IdGenerate {
* 生成UUID, 中间无-分割.
*/
public static String uuid() {
return UUID.randomUUID().toString().replaceAll("-", "");
return StringUtils.replace(UUID.randomUUID().toString(),"-", "");
}
/**

View File

@@ -6,6 +6,8 @@ package com.jeesite.common.utils.excel.fieldtype;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import org.apache.commons.lang3.StringUtils;
/**
* 金额类型转换(保留两位)
@@ -19,7 +21,7 @@ public class MoneyType {
* 获取对象值(导入)
*/
public static Object getValue(String val) {
return val == null ? "" : val.replaceAll(",", "");
return val == null ? "" : StringUtils.replace(val, ",", "");
}
/**