import cn.hutool.core.util.StrUtil;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* @author atom
*/
public class StrUtils extends StrUtil {
public static final String UNKNOWN = "unknown";
public static final String UTF_8 = "UTF-8";
public static String format(@Nullable String message, @Nullable Object... arguments) {
// message 为 null 返回空字符串
if (message == null) {
return StrUtil.EMPTY;
}
// 参数为 null 或者为空
if (arguments == null || arguments.length == 0) {
return message;
}
StringBuilder sb = new StringBuilder((int) (message.length() * 1.5));
int cursor = 0;
int index = 0;
int argsLength = arguments.length;
for (int start, end; (start = message.indexOf('{', cursor)) != -1 && (end = message.indexOf(&
最后
以上就是快乐学姐最近收集整理的关于字符串处理类-StrUtils的全部内容,更多相关字符串处理类-StrUtils内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复