Package com.qiniu.util
Class StringUtils
- java.lang.Object
-
- com.qiniu.util.StringUtils
-
public final class StringUtils extends java.lang.Object字符串连接工具类
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleaninStringArray(java.lang.String s, java.lang.String[] array)static booleanisNullOrEmpty(java.lang.String s)static java.lang.Stringjoin(java.lang.Object[] array, java.lang.String sep)static java.lang.Stringjoin(java.lang.Object[] array, java.lang.String sep, java.lang.String prefix)以指定的分隔符来进行字符串元素连接static java.lang.Stringjoin(java.util.Collection list, java.lang.String sep)static java.lang.Stringjoin(java.util.Collection list, java.lang.String sep, java.lang.String prefix)static java.lang.StringjsonJoin(java.lang.String[] array)以json元素的方式连接字符串中元素static java.lang.Stringmd5Lower(java.lang.String src)static byte[]utf8Bytes(java.lang.String data)static java.lang.Stringutf8String(byte[] data)
-
-
-
Method Detail
-
join
public static java.lang.String join(java.lang.Object[] array, java.lang.String sep)- Parameters:
array- arraysep- sep- Returns:
- 拼接后的字符串
- See Also:
join(Object[] array, String sep, String prefix)
-
join
public static java.lang.String join(java.util.Collection list, java.lang.String sep)- Parameters:
list- listsep- sep- Returns:
- 拼接后的字符串
- See Also:
join(Object[] array, String sep, String prefix)
-
join
public static java.lang.String join(java.util.Collection list, java.lang.String sep, java.lang.String prefix)- Parameters:
list- listsep- sepprefix- 前缀- Returns:
- 拼接后的字符串
- See Also:
join(Object[] array, String sep, String prefix)
-
join
public static java.lang.String join(java.lang.Object[] array, java.lang.String sep, java.lang.String prefix)以指定的分隔符来进行字符串元素连接例如有字符串数组array和连接符为逗号(,)
String[] array = new String[] { "hello", "world", "qiniu", "cloud","storage" };那么得到的结果是:hello,world,qiniu,cloud,storage- Parameters:
array- 需要连接的对象数组sep- 元素连接之间的分隔符prefix- 前缀字符串- Returns:
- 连接好的新字符串
-
jsonJoin
public static java.lang.String jsonJoin(java.lang.String[] array)
以json元素的方式连接字符串中元素例如有字符串数组array
String[] array = new String[] { "hello", "world", "qiniu", "cloud","storage" };那么得到的结果是:"hello","world","qiniu","cloud","storage"- Parameters:
array- 需要连接的字符串数组- Returns:
- 以json元素方式连接好的新字符串
-
isNullOrEmpty
public static boolean isNullOrEmpty(java.lang.String s)
-
inStringArray
public static boolean inStringArray(java.lang.String s, java.lang.String[] array)
-
utf8Bytes
public static byte[] utf8Bytes(java.lang.String data)
-
utf8String
public static java.lang.String utf8String(byte[] data)
-
md5Lower
public static java.lang.String md5Lower(java.lang.String src) throws java.security.NoSuchAlgorithmException- Throws:
java.security.NoSuchAlgorithmException
-
-