类 StrUtil
java.lang.Object
org.tio.utils.hutool.StrUtil
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringarrayToString(Object obj) 数组或集合转Stringstatic booleancontains(CharSequence str, char searchChar) 指定字符是否在字符串中出现过static booleancontainsAny(CharSequence str, CharSequence... testStrs) 查找指定字符串是否包含指定字符串列表中的任意一个字符串static booleancontainsIgnoreCase(CharSequence str, CharSequence testStr) 是否包含特定字符,忽略大小写,如果给定两个参数都为null,返回truestatic Objectstatic Objectstatic booleanendWith(CharSequence str, char c) 字符串是否以给定字符结尾static booleanendWith(CharSequence str, CharSequence suffix) 是否以指定字符串结尾static booleanendWith(CharSequence str, CharSequence suffix, boolean isIgnoreCase) 是否以指定字符串结尾
如果给定的字符串和开头字符串都为null则返回true,否则任意一个值为null返回falsestatic booleanendWithIgnoreCase(CharSequence str, CharSequence suffix) 是否以指定字符串结尾,忽略大小写static booleanequals(CharSequence str1, CharSequence str2) 比较两个字符串(大小写敏感)。static booleanequals(CharSequence str1, CharSequence str2, boolean ignoreCase) 比较两个字符串是否相等。static booleanequalsIgnoreCase(CharSequence str1, CharSequence str2) 比较两个字符串(大小写不敏感)。static String将已有字符串填充为规定长度,如果已有字符串超过这个长度则返回这个字符串static String将已有字符串填充为规定长度,如果已有字符串超过这个长度则返回这个字符串
字符填充于字符串后static StringgetContainsStr(CharSequence str, CharSequence... testStrs) 查找指定字符串是否包含指定字符串列表中的任意一个字符串,如果包含返回找到的第一个字符串static intindexOf(CharSequence str, char searchChar) 指定范围内查找指定字符static intindexOf(CharSequence str, char searchChar, int start) 指定范围内查找指定字符static intindexOf(CharSequence str, char searchChar, int start, int end) 指定范围内查找指定字符static intindexOf(CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) 指定范围内反向查找字符串static intindexOfIgnoreCase(CharSequence str, CharSequence searchStr) 指定范围内查找字符串,忽略大小写static intindexOfIgnoreCase(CharSequence str, CharSequence searchStr, int fromIndex) 指定范围内查找字符串static Stringint2Str(int data) 用缓存将int转成strstatic booleanisBlank(CharSequence str) 字符串是否为空白 空白的定义如下:
1、为null
2、为不可见字符(如空格)
3、""static booleanisEmpty(CharSequence str) 字符串是否为空,空的定义如下:
1、为null
2、为""static booleanisNotBlank(CharSequence str) 字符串是否为非空白 空白的定义如下:
1、不为null
2、不为不可见字符(如空格)
3、不为""static booleanisSubEquals(CharSequence str1, int start1, CharSequence str2, int start2, int length, boolean ignoreCase) 截取两个字符串的不同部分(长度一致),判断截取的子串是否相同
任意一个字符串为null返回falsestatic Stringjoin(Collection<?> coll) 以 , 为分隔符将多个对象转换为字符串static Stringjoin(Collection<?> coll, CharSequence delimiter) 以 delimiter 为分隔符将多个对象转换为字符串static intlastIndexOf(CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) 指定范围内查找字符串static intlastIndexOfIgnoreCase(CharSequence str, CharSequence searchStr) 指定范围内查找字符串,忽略大小写static intlastIndexOfIgnoreCase(CharSequence str, CharSequence searchStr, int fromIndex) 指定范围内查找字符串,忽略大小写static StringlowerFirst(CharSequence str) 小写首字母
例如:str = Name, return namestatic StringmaxLength(CharSequence string, int length) 限制字符串长度,如果超过指定长度,截取指定长度并在末尾加"..."static Stringrepeat(char c, int count) 重复某个字符static String[]static booleanstartWith(CharSequence str, char c) 字符串是否以给定字符开始static booleanstartWith(CharSequence str, CharSequence prefix) 是否以指定字符串开头static booleanstartWith(CharSequence str, CharSequence prefix, boolean isIgnoreCase) 是否以指定字符串开头
如果给定的字符串和开头字符串都为null则返回true,否则任意一个值为null返回falsestatic booleanstartWithIgnoreCase(CharSequence str, CharSequence prefix) 是否以指定字符串开头,忽略大小写static Stringstr(CharSequence cs) CharSequence转为字符串,null安全static String将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法static String将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法static Stringsub(CharSequence str, int fromIndex, int toIndex) 改进JDK subString
index从0开始计算,最后一个字符为-1
如果from和to位置一样,返回 ""
如果from或to为负数,则按照length从后向前数位置,如果绝对值大于字符串长度,则from归到0,to归到length
如果经过修正的index中from大于to,则互换from和to example:
abcdefgh 2 3 =》 c
abcdefgh 2 -3 =》 cdestatic StringsubAfter(CharSequence string, CharSequence separator, boolean isLastSeparator) 截取分隔字符串之后的字符串,不包括分隔字符串
如果给定的字符串为空串(null或""),返回原字符串
如果分隔字符串为空串(null或""),则返回空串,如果分隔字符串未找到,返回空串 栗子:static StringsubBefore(CharSequence string, CharSequence separator, boolean isLastSeparator) 截取分隔字符串之前的字符串,不包括分隔字符串
如果给定的字符串为空串(null或"")或者分隔字符串为null,返回原字符串
如果分隔字符串为空串"",则返回空串,如果分隔字符串未找到,返回原字符串 栗子:static StringsubBetween(CharSequence str, CharSequence beforeAndAfter) 截取指定字符串中间部分,不包括标识字符串
栗子:static StringsubBetween(CharSequence str, CharSequence before, CharSequence after) 截取指定字符串中间部分,不包括标识字符串
栗子:static StringsubPre(CharSequence string, int toIndex) 切割指定位置之前部分的字符串static StringsubPreGbk(CharSequence str, int len, CharSequence suffix) 截取部分字符串,这里一个汉字的长度认为是2static StringsubSuf(CharSequence string, int fromIndex) 切割指定位置之后部分的字符串static StringsubSufByLength(CharSequence string, int length) 切割指定长度的后部分的字符串static StringsubWithLength(String input, int fromIndex, int length) 截取字符串,从指定位置开始,截取指定长度的字符串
author weibaohuistatic String去除字符串两边空白符,传入null也返回nullstatic StringtrimEnd(CharSequence str) 除去字符串尾部的空白,如果字符串是null,则返回null。static StringtrimStart(CharSequence str) 除去字符串头部的空白,如果字符串是null,则返回null。static StringupperFirst(CharSequence str) 大写首字母
例如:str = name, return Namestatic String将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
-
字段详细资料
-
构造器详细资料
-
StrUtil
public StrUtil()
-
-
方法详细资料
-
int2Str
用缓存将int转成str- 参数:
data-- 返回:
-
trim
去除字符串两边空白符,传入null也返回null- 参数:
value- 值- 返回:
- 去除空白符的值
-
isEmpty
字符串是否为空,空的定义如下:
1、为null
2、为""- 参数:
str- 被检测的字符串- 返回:
- 是否为空
-
isNotBlank
字符串是否为非空白 空白的定义如下:
1、不为null
2、不为不可见字符(如空格)
3、不为""- 参数:
str- 被检测的字符串- 返回:
- 是否为非空
-
isBlank
字符串是否为空白 空白的定义如下:
1、为null
2、为不可见字符(如空格)
3、""- 参数:
str- 被检测的字符串- 返回:
- 是否为空
-
arrayToString
数组或集合转String- 参数:
obj- 集合或数组对象- 返回:
- 数组字符串,与集合转字符串格式相同
-
startWithIgnoreCase
是否以指定字符串开头,忽略大小写- 参数:
str- 被监测字符串prefix- 开头字符串- 返回:
- 是否以指定字符串开头
-
startWith
是否以指定字符串开头
如果给定的字符串和开头字符串都为null则返回true,否则任意一个值为null返回false- 参数:
str- 被监测字符串prefix- 开头字符串isIgnoreCase- 是否忽略大小写- 返回:
- 是否以指定字符串开头
-
equals
比较两个字符串(大小写敏感)。equals(null, null) = true equals(null, "abc") = false equals("abc", null) = false equals("abc", "abc") = true equals("abc", "ABC") = false- 参数:
str1- 要比较的字符串1str2- 要比较的字符串2- 返回:
- 如果两个字符串相同,或者都是
null,则返回true
-
equalsIgnoreCase
比较两个字符串(大小写不敏感)。equalsIgnoreCase(null, null) = true equalsIgnoreCase(null, "abc") = false equalsIgnoreCase("abc", null) = false equalsIgnoreCase("abc", "abc") = true equalsIgnoreCase("abc", "ABC") = true- 参数:
str1- 要比较的字符串1str2- 要比较的字符串2- 返回:
- 如果两个字符串相同,或者都是
null,则返回true
-
equals
比较两个字符串是否相等。- 参数:
str1- 要比较的字符串1str2- 要比较的字符串2ignoreCase- 是否忽略大小写- 返回:
- 如果两个字符串相同,或者都是
null,则返回true - 从以下版本开始:
- 3.2.0
-
fillAfter
将已有字符串填充为规定长度,如果已有字符串超过这个长度则返回这个字符串
字符填充于字符串后- 参数:
str- 被填充的字符串filledChar- 填充的字符len- 填充长度- 返回:
- 填充后的字符串
- 从以下版本开始:
- 3.1.2
-
fill
将已有字符串填充为规定长度,如果已有字符串超过这个长度则返回这个字符串- 参数:
str- 被填充的字符串filledChar- 填充的字符len- 填充长度isPre- 是否填充在前- 返回:
- 填充后的字符串
- 从以下版本开始:
- 3.1.2
-
repeat
重复某个字符- 参数:
c- 被重复的字符count- 重复的数目,如果小于等于0则返回""- 返回:
- 重复字符字符串
-
trimStart
除去字符串头部的空白,如果字符串是null,则返回null。注意,和
String.trim不同,此方法使用CharUtil.isBlankChar来判定空白, 因而可以除去英文字符集之外的其它空白,如中文空格。trimStart(null) = null trimStart("") = "" trimStart("abc") = "abc" trimStart(" abc") = "abc" trimStart("abc ") = "abc " trimStart(" abc ") = "abc "- 参数:
str- 要处理的字符串- 返回:
- 除去空白的字符串,如果原字串为
null或结果字符串为"",则返回null
-
trimEnd
除去字符串尾部的空白,如果字符串是null,则返回null。注意,和
String.trim不同,此方法使用CharUtil.isBlankChar来判定空白, 因而可以除去英文字符集之外的其它空白,如中文空格。trimEnd(null) = null trimEnd("") = "" trimEnd("abc") = "abc" trimEnd(" abc") = " abc" trimEnd("abc ") = "abc" trimEnd(" abc ") = " abc"- 参数:
str- 要处理的字符串- 返回:
- 除去空白的字符串,如果原字串为
null或结果字符串为"",则返回null
-
indexOf
指定范围内查找指定字符- 参数:
str- 字符串searchChar- 被查找的字符- 返回:
- 位置
-
indexOf
指定范围内查找指定字符- 参数:
str- 字符串searchChar- 被查找的字符start- 起始位置,如果小于0,从0开始查找- 返回:
- 位置
-
indexOf
指定范围内查找指定字符- 参数:
str- 字符串searchChar- 被查找的字符start- 起始位置,如果小于0,从0开始查找end- 终止位置,如果超过str.length()则默认查找到字符串末尾- 返回:
- 位置
-
indexOfIgnoreCase
指定范围内查找字符串,忽略大小写
StrUtil.indexOfIgnoreCase(null, *, *) = -1 StrUtil.indexOfIgnoreCase(*, null, *) = -1 StrUtil.indexOfIgnoreCase("", "", 0) = 0 StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2 StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1 StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2 StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2 StrUtil.indexOfIgnoreCase("abc", "", 9) = -1- 参数:
str- 字符串searchStr- 需要查找位置的字符串- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
indexOfIgnoreCase
指定范围内查找字符串StrUtil.indexOfIgnoreCase(null, *, *) = -1 StrUtil.indexOfIgnoreCase(*, null, *) = -1 StrUtil.indexOfIgnoreCase("", "", 0) = 0 StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2 StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5 StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1 StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2 StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2 StrUtil.indexOfIgnoreCase("abc", "", 9) = -1- 参数:
str- 字符串searchStr- 需要查找位置的字符串fromIndex- 起始位置- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
indexOf
public static int indexOf(CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) 指定范围内反向查找字符串- 参数:
str- 字符串searchStr- 需要查找位置的字符串fromIndex- 起始位置ignoreCase- 是否忽略大小写- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
lastIndexOfIgnoreCase
指定范围内查找字符串,忽略大小写- 参数:
str- 字符串searchStr- 需要查找位置的字符串- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
lastIndexOfIgnoreCase
指定范围内查找字符串,忽略大小写- 参数:
str- 字符串searchStr- 需要查找位置的字符串fromIndex- 起始位置,从后往前计数- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
lastIndexOf
public static int lastIndexOf(CharSequence str, CharSequence searchStr, int fromIndex, boolean ignoreCase) 指定范围内查找字符串- 参数:
str- 字符串searchStr- 需要查找位置的字符串fromIndex- 起始位置,从后往前计数ignoreCase- 是否忽略大小写- 返回:
- 位置
- 从以下版本开始:
- 3.2.1
-
isSubEquals
public static boolean isSubEquals(CharSequence str1, int start1, CharSequence str2, int start2, int length, boolean ignoreCase) 截取两个字符串的不同部分(长度一致),判断截取的子串是否相同
任意一个字符串为null返回false- 参数:
str1- 第一个字符串start1- 第一个字符串开始的位置str2- 第二个字符串start2- 第二个字符串开始的位置length- 截取长度ignoreCase- 是否忽略大小写- 返回:
- 子串是否相同
- 从以下版本开始:
- 3.2.1
-
startWith
字符串是否以给定字符开始- 参数:
str- 字符串c- 字符- 返回:
- 是否开始
-
startWith
是否以指定字符串开头- 参数:
str- 被监测字符串prefix- 开头字符串- 返回:
- 是否以指定字符串开头
-
endWith
字符串是否以给定字符结尾- 参数:
str- 字符串c- 字符- 返回:
- 是否结尾
-
endWith
是否以指定字符串结尾
如果给定的字符串和开头字符串都为null则返回true,否则任意一个值为null返回false- 参数:
str- 被监测字符串suffix- 结尾字符串isIgnoreCase- 是否忽略大小写- 返回:
- 是否以指定字符串结尾
-
endWith
是否以指定字符串结尾- 参数:
str- 被监测字符串suffix- 结尾字符串- 返回:
- 是否以指定字符串结尾
-
endWithIgnoreCase
是否以指定字符串结尾,忽略大小写- 参数:
str- 被监测字符串suffix- 结尾字符串- 返回:
- 是否以指定字符串结尾
-
contains
指定字符是否在字符串中出现过- 参数:
str- 字符串searchChar- 被查找的字符- 返回:
- 是否包含
- 从以下版本开始:
- 3.1.2
-
containsIgnoreCase
是否包含特定字符,忽略大小写,如果给定两个参数都为null,返回true- 参数:
str- 被检测字符串testStr- 被测试是否包含的字符串- 返回:
- 是否包含
-
split
- 参数:
str-separator-- 返回:
-
utf8Str
将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法- 参数:
obj- 对象- 返回:
- 字符串
-
str
将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法- 参数:
obj- 对象charsetName- 字符集- 返回:
- 字符串
-
str
将对象转为字符串
1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法- 参数:
obj- 对象charset- 字符集- 返回:
- 字符串
-
str
CharSequence转为字符串,null安全- 参数:
cs-CharSequence- 返回:
- 字符串
-
sub
改进JDK subString
index从0开始计算,最后一个字符为-1
如果from和to位置一样,返回 ""
如果from或to为负数,则按照length从后向前数位置,如果绝对值大于字符串长度,则from归到0,to归到length
如果经过修正的index中from大于to,则互换from和to example:
abcdefgh 2 3 =》 c
abcdefgh 2 -3 =》 cde- 参数:
str- StringfromIndex- 开始的index(包括)toIndex- 结束的index(不包括)- 返回:
- 字串
-
subPreGbk
截取部分字符串,这里一个汉字的长度认为是2- 参数:
str- 字符串len- 切割的位置suffix- 切割后加上后缀- 返回:
- 切割后的字符串
- 从以下版本开始:
- 3.1.1
-
maxLength
限制字符串长度,如果超过指定长度,截取指定长度并在末尾加"..."- 参数:
string- 字符串length- 最大长度- 返回:
- 切割后的剩余的前半部分字符串+"..."
- 从以下版本开始:
- 4.0.10
-
subPre
切割指定位置之前部分的字符串- 参数:
string- 字符串toIndex- 切割到的位置(不包括)- 返回:
- 切割后的剩余的前半部分字符串
-
subSuf
切割指定位置之后部分的字符串- 参数:
string- 字符串fromIndex- 切割开始的位置(包括)- 返回:
- 切割后后剩余的后半部分字符串
-
subSufByLength
切割指定长度的后部分的字符串StrUtil.subSufByLength("abcde", 3) = "cde" StrUtil.subSufByLength("abcde", 0) = "" StrUtil.subSufByLength("abcde", -5) = "" StrUtil.subSufByLength("abcde", -1) = "" StrUtil.subSufByLength("abcde", 5) = "abcde" StrUtil.subSufByLength("abcde", 10) = "abcde" StrUtil.subSufByLength(null, 3) = null- 参数:
string- 字符串length- 切割长度- 返回:
- 切割后后剩余的后半部分字符串
- 从以下版本开始:
- 4.0.1
-
subWithLength
截取字符串,从指定位置开始,截取指定长度的字符串
author weibaohui- 参数:
input- 原始字符串fromIndex- 开始的index,包括length- 要截取的长度- 返回:
- 截取后的字符串
-
subBefore
public static String subBefore(CharSequence string, CharSequence separator, boolean isLastSeparator) 截取分隔字符串之前的字符串,不包括分隔字符串
如果给定的字符串为空串(null或"")或者分隔字符串为null,返回原字符串
如果分隔字符串为空串"",则返回空串,如果分隔字符串未找到,返回原字符串 栗子:StrUtil.subBefore(null, *) = null StrUtil.subBefore("", *) = "" StrUtil.subBefore("abc", "a") = "" StrUtil.subBefore("abcba", "b") = "a" StrUtil.subBefore("abc", "c") = "ab" StrUtil.subBefore("abc", "d") = "abc" StrUtil.subBefore("abc", "") = "" StrUtil.subBefore("abc", null) = "abc"- 参数:
string- 被查找的字符串separator- 分隔字符串(不包括)isLastSeparator- 是否查找最后一个分隔字符串(多次出现分隔字符串时选取最后一个),true为选取最后一个- 返回:
- 切割后的字符串
- 从以下版本开始:
- 3.1.1
-
subAfter
截取分隔字符串之后的字符串,不包括分隔字符串
如果给定的字符串为空串(null或""),返回原字符串
如果分隔字符串为空串(null或""),则返回空串,如果分隔字符串未找到,返回空串 栗子:StrUtil.subAfter(null, *) = null StrUtil.subAfter("", *) = "" StrUtil.subAfter(*, null) = "" StrUtil.subAfter("abc", "a") = "bc" StrUtil.subAfter("abcba", "b") = "cba" StrUtil.subAfter("abc", "c") = "" StrUtil.subAfter("abc", "d") = "" StrUtil.subAfter("abc", "") = "abc"- 参数:
string- 被查找的字符串separator- 分隔字符串(不包括)isLastSeparator- 是否查找最后一个分隔字符串(多次出现分隔字符串时选取最后一个),true为选取最后一个- 返回:
- 切割后的字符串
- 从以下版本开始:
- 3.1.1
-
subBetween
截取指定字符串中间部分,不包括标识字符串
栗子:StrUtil.subBetween("wx[b]yz", "[", "]") = "b" StrUtil.subBetween(null, *, *) = null StrUtil.subBetween(*, null, *) = null StrUtil.subBetween(*, *, null) = null StrUtil.subBetween("", "", "") = "" StrUtil.subBetween("", "", "]") = null StrUtil.subBetween("", "[", "]") = null StrUtil.subBetween("yabcz", "", "") = "" StrUtil.subBetween("yabcz", "y", "z") = "abc" StrUtil.subBetween("yabczyabcz", "y", "z") = "abc"- 参数:
str- 被切割的字符串before- 截取开始的字符串标识after- 截取到的字符串标识- 返回:
- 截取后的字符串
- 从以下版本开始:
- 3.1.1
-
subBetween
截取指定字符串中间部分,不包括标识字符串
栗子:StrUtil.subBetween(null, *) = null StrUtil.subBetween("", "") = "" StrUtil.subBetween("", "tag") = null StrUtil.subBetween("tagabctag", null) = null StrUtil.subBetween("tagabctag", "") = "" StrUtil.subBetween("tagabctag", "tag") = "abc"- 参数:
str- 被切割的字符串beforeAndAfter- 截取开始和结束的字符串标识- 返回:
- 截取后的字符串
- 从以下版本开始:
- 3.1.1
-
convert
- 参数:
type-value-- 返回:
- 抛出:
Exception
-
convert
- 参数:
type-values-- 返回:
- 返回的也是一个数组
- 抛出:
Exception
-
containsAny
查找指定字符串是否包含指定字符串列表中的任意一个字符串- 参数:
str- 指定字符串testStrs- 需要检查的字符串数组- 返回:
- 是否包含任意一个字符串
- 从以下版本开始:
- 3.2.0
-
getContainsStr
查找指定字符串是否包含指定字符串列表中的任意一个字符串,如果包含返回找到的第一个字符串- 参数:
str- 指定字符串testStrs- 需要检查的字符串数组- 返回:
- 被包含的第一个字符串
- 从以下版本开始:
- 3.2.0
-
upperFirst
大写首字母
例如:str = name, return Name- 参数:
str- 字符串- 返回:
- 字符串
-
lowerFirst
小写首字母
例如:str = Name, return name- 参数:
str- 字符串- 返回:
- 字符串
-
join
以 , 为分隔符将多个对象转换为字符串- 参数:
coll- 集合- 返回:
- 连接后的字符串
-
join
以 delimiter 为分隔符将多个对象转换为字符串- 参数:
coll- 集合delimiter- 分隔符- 返回:
- 连接后的字符串
-