mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
change methods
This commit is contained in:
parent
671b6fa6a9
commit
0f5133013d
@ -1203,31 +1203,6 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 以 conjunction 为分隔符将数组转换为字符串
|
||||
*
|
||||
* @param array 数组
|
||||
* @param conjunction 分隔符
|
||||
* @return 连接后的字符串
|
||||
*/
|
||||
public static String join(long[] array, CharSequence conjunction) {
|
||||
if (null == array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
boolean isFirst = true;
|
||||
for (long item : array) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
sb.append(conjunction);
|
||||
}
|
||||
sb.append(item);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 以 conjunction 为分隔符将数组转换为字符串
|
||||
*
|
||||
|
@ -1613,6 +1613,31 @@ public class PrimitiveArrayUtil {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 以 conjunction 为分隔符将数组转换为字符串
|
||||
*
|
||||
* @param array 数组
|
||||
* @param conjunction 分隔符
|
||||
* @return 连接后的字符串
|
||||
*/
|
||||
public static String join(long[] array, CharSequence conjunction) {
|
||||
if (null == array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
boolean isFirst = true;
|
||||
for (long item : array) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
sb.append(conjunction);
|
||||
}
|
||||
sb.append(item);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 以 conjunction 为分隔符将数组转换为字符串
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user