Package com.foxinmy.weixin4j.util
Class StringUtil
- java.lang.Object
-
- com.foxinmy.weixin4j.util.StringUtil
-
public final class StringUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMPTY
static int
INDEX_NOT_FOUND
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
capitalize(String str)
static byte[]
getBytesUtf8(String content)
static boolean
isBlank(CharSequence cs)
static boolean
isEmpty(CharSequence cs)
static boolean
isNotBlank(CharSequence cs)
static String
join(int[] array, char separator)
static String
join(int[] array, char separator, int startIndex, int endIndex)
static String
join(Iterable<?> iterable, char separator)
static String
join(Object[] array, char separator)
static String
join(Object[] array, char separator, int startIndex, int endIndex)
static String
join(Iterator<?> iterator, char separator)
static String
newStringUtf8(byte[] bytes)
static String
simpleClassName(Class<?> clazz)
Generates a simplified name from aClass
.static String
simpleClassName(Object o)
The shortcut tosimpleClassName(o.getClass())
.static String
substringAfter(String str, String separator)
static String
substringBefore(String str, String separator)
static String[]
tokenizeToStringArray(String str, String delimiters)
static String[]
tokenizeToStringArray(String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens)
static String
uncapitalize(String str)
-
-
-
Field Detail
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
INDEX_NOT_FOUND
public static final int INDEX_NOT_FOUND
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBytesUtf8
public static byte[] getBytesUtf8(String content)
-
newStringUtf8
public static String newStringUtf8(byte[] bytes)
-
isEmpty
public static boolean isEmpty(CharSequence cs)
-
isBlank
public static boolean isBlank(CharSequence cs)
-
isNotBlank
public static boolean isNotBlank(CharSequence cs)
-
join
public static String join(int[] array, char separator)
-
join
public static String join(int[] array, char separator, int startIndex, int endIndex)
-
simpleClassName
public static String simpleClassName(Object o)
The shortcut tosimpleClassName(o.getClass())
.
-
simpleClassName
public static String simpleClassName(Class<?> clazz)
Generates a simplified name from aClass
. Similar toClass.getSimpleName()
, but it works fine with anonymous classes.
-
-