Package org.xipki.util
Class StringUtil
- java.lang.Object
-
- org.xipki.util.StringUtil
-
public class StringUtil extends Object
Utility class for String.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcollectionAsString(Collection<String> set, String delim)static Stringconcat(String s1, String... strs)static StringconcatObjects(Object o1, Object... objs)static StringconcatObjectsCap(int cap, Object o1, Object... objs)static StringformatAccount(long account, boolean withPrefix)static StringformatAccount(long account, int minLen)static StringformatText(String text, int minLen)static StringformatTime(long seconds, boolean withPrefix)static StringformatTime(long seconds, int minLen)static StringgetVersion(Class clazz)static booleanisBlank(String str)static booleanisNotBlank(String str)static booleanisNumber(String str)static booleanisNumber(String str, int radix)static char[]merge(char[][] parts)static booleanorEqualsIgnoreCase(String str, String... tokens)static List<String>split(String str, String delim)static Set<String>splitAsSet(String str, String delim)static booleanstartsWithIgnoreCase(String str, String prefix)static BigIntegertoBigInt(String str)static BigIntegertoBigInt(String str, boolean defaultHex)static byte[]toUtf8Bytes(String str)static StringtoUtf8String(byte[] bytes)
-
-
-
Method Detail
-
isBlank
public static boolean isBlank(String str)
-
isNotBlank
public static boolean isNotBlank(String str)
-
collectionAsString
public static String collectionAsString(Collection<String> set, String delim)
-
isNumber
public static boolean isNumber(String str)
-
isNumber
public static boolean isNumber(String str, int radix)
-
formatAccount
public static String formatAccount(long account, boolean withPrefix)
-
formatAccount
public static String formatAccount(long account, int minLen)
-
formatTime
public static String formatTime(long seconds, boolean withPrefix)
-
formatTime
public static String formatTime(long seconds, int minLen)
-
merge
public static char[] merge(char[][] parts)
-
toUtf8Bytes
public static byte[] toUtf8Bytes(String str)
-
toUtf8String
public static String toUtf8String(byte[] bytes)
-
toBigInt
public static BigInteger toBigInt(String str)
-
toBigInt
public static BigInteger toBigInt(String str, boolean defaultHex)
-
-