public class StringUtils extends Object
限定符和类型 | 字段和说明 |
---|---|
static int |
INDEX_NOT_FOUND |
限定符和类型 | 方法和说明 |
---|---|
static String |
byte2hex(byte[] b)
byte to hex
|
static String |
byte2String(byte[] value)
bytes to String
|
static int |
byteArray2int(byte[] b)
byte[] to int
|
static byte[] |
byteXorInt(byte[] data,
int xor)
byte[] xor int
|
static String |
formatSize(long value)
format size
|
static String |
formatSpeed(long value)
format speed /s
|
static String |
formatTime(int second)
format time
|
static String |
formatZhNum(long num)
格式化为中文数量
|
static byte[] |
int2byteArray(int num)
int to byte[]
|
static boolean |
isBlank(String str)
Returns true if the string is null or 0-length.
|
static boolean |
isEmpty(String str)
Returns true if the string is null or 0-length.
|
static boolean |
isNotBlank(String str)
Returns true if the string is null or ''.
|
static boolean |
isNotEmpty(String str)
Returns false if the string is null or 0-length.
|
static boolean |
isNumeric(String str)
isNumeric
|
static boolean |
isNumericSpace(String str)
isNumericSpace
|
static String |
md5(byte[] bytes)
MD5 byte[]
|
static String |
md5(String s)
MD5 s
|
static String |
null2Empty(String str) |
static String |
null2Zero(String str)
Returns string if the string is null or ''.
|
static String |
replaceTableSpace(String str)
remove TableSpace
|
static String |
replaceWhiteSpace(String str)
remove TableSpace
|
static String |
reverse(String value)
反转
|
static String |
strip(String str)
strip
|
static String |
strip(String str,
String stripChars)
strip start|end
|
static String |
stripEnd(String str,
String stripChars) |
static String |
stripStart(String str,
String stripChars)
strip Start
|
static String |
trimAllWhitespace(String str)
repalce all Whitespace
|
static String |
trimForFront(String str)
remove front Whitespace
|
static String |
trimToEmpty(String str)
str the String to be trimmed, may be null
|
public static final int INDEX_NOT_FOUND
public static String byte2String(byte[] value)
value
- public static String byte2hex(byte[] b)
b
- public static String formatZhNum(long num)
num
- public static String formatSpeed(long value)
value
- public static String formatSize(long value)
value
- public static String formatTime(int second)
second
- public static String md5(byte[] bytes)
bytes
- public static boolean isBlank(String str)
str
- public static boolean isEmpty(String str)
str
- public static boolean isNotEmpty(String str)
str
- public static boolean isNotBlank(String str)
str
- public static String null2Zero(String str)
public static String replaceWhiteSpace(String str)
str
- public static String replaceTableSpace(String str)
str
- public static String trimToEmpty(String str)
str
- public static String trimAllWhitespace(String str)
str
- public static String stripStart(String str, String stripChars)
str
- stripChars
- public static String strip(String str, String stripChars)
str
- stripChars
- public static boolean isNumeric(String str)
str
- public static boolean isNumericSpace(String str)
str
- public static byte[] byteXorInt(byte[] data, int xor)
data
- xor
- public static int byteArray2int(byte[] b)
b
- public static byte[] int2byteArray(int num)
num
-