public class StringUtils extends Object
Constructor and Description |
---|
StringUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
appendIfNotContain(String str,
String appendStr,
String otherwise)
如果给定字符串
str 中不包含appendStr ,则在str 后追加appendStr ;
如果已包含appendStr ,则在str 后追加otherwise |
static byte[] |
bytes(CharSequence str,
Charset charset)
编码字符串
|
static boolean |
isEmpty(String str) |
static boolean |
isNotEmpty(String str) |
static String |
str(byte[] data,
Charset charset)
解码字节码
|
public static boolean isEmpty(String str)
public static boolean isNotEmpty(String str)
public static String appendIfNotContain(String str, String appendStr, String otherwise)
str
中不包含appendStr
,则在str
后追加appendStr
;
如果已包含appendStr
,则在str
后追加otherwise
str
- 给定的字符串appendStr
- 需要追加的内容otherwise
- 当appendStr
不满足时追加到str
后的内容public static byte[] bytes(CharSequence str, Charset charset)
str
- 字符串charset
- 字符集,如果此字段为空,则解码的结果取决于平台Copyright © 2021. All rights reserved.