public class StringUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
formatBinarySize(long size)
long size to string
|
static int |
indexOf(String[] array,
String v)
Returns the index within this string array of the first occurrence of
the specified string.
|
static boolean |
isBlank(CharSequence cs)
Checks if a CharSequence is empty (""), null or whitespace only.
|
static boolean |
isEmpty(String s)
|
static boolean |
isNotBlank(CharSequence cs)
Checks if a CharSequence is not empty (""), not null and not whitespace only.
|
static boolean |
isNotEmpty(String s)
|
static String |
lowFirstKey(String key)
Turn the first character into an lower case.
|
static void |
swap(String[] values,
int a,
int b)
Wrap value in string array
|
static String |
timeToString(long t)
Time millis to String, like 1h:3s or 4m:1s
|
static String |
toPascalCase(String name)
Convert to camel case string.
|
static String |
uppFirstKey(String key)
Turn the first character into an upper case.
|
public static boolean isEmpty(String s)
s - string value to checktrue if null or String.length() is 0, otherwise
falsepublic static boolean isNotEmpty(String s)
s - string value to checktrue if String.length() greater than 0, otherwise
falsepublic static int indexOf(String[] array, String v)
If no such string occurs in this array, then -1 is returned.
array - array to searchv - the specify string-1 if the string does not occur.public static String uppFirstKey(String key)
32.key - a string to processorpublic static String lowFirstKey(String key)
32.key - a string to processorpublic static String toPascalCase(String name)
name - a string to processorpublic static void swap(String[] values, int a, int b)
values - the array to warpa - from indexb - to indexpublic static boolean isBlank(CharSequence cs)
cs - the CharSequence to check, may be nulltrue if the CharSequence is null, empty or whitespace onlypublic static boolean isNotBlank(CharSequence cs)
cs - the CharSequence to check, may be nulltrue if the CharSequence is
not empty and not null and not whitespace onlypublic static String formatBinarySize(long size)
size - file size in bytespublic static String timeToString(long t)
t - time millisCopyright © 2022. All rights reserved.