public class StringUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
bytesToHexStr(byte[] bytes)
byte[] 转化为16进制字符串输出
|
static String |
format(String formatMsg,
Object... args)
格式化字符串
此方法只是简单将指定占位符 按照顺序替换为参数 如果想输出占位符使用 \\转义即可,如果想输出占位符之前的 \ 使用双转义符 \\\\ 即可 例: 通常使用:format("this is {} for {}", "{}", "a", "b") =》 this is a for b 转义{}: format("this is \\{} for {}", "{}", "a", "b") =》 this is {} for a 转义\: format("this is \\\\{} for {}", "{}", "a", "b") =》 this is \a for b |
static boolean |
hasText(String str) |
static boolean |
isEmpty(CharSequence str) |
public static String format(String formatMsg, Object... args)
formatMsg - 字符串模板args - 参数列表public static boolean hasText(String str)
public static boolean isEmpty(CharSequence str)
public static String bytesToHexStr(byte[] bytes)
bytes - 字节数组Copyright © 2023. All rights reserved.