change methods

This commit is contained in:
Looly 2021-06-07 19:10:06 +08:00
parent 671b6fa6a9
commit 0f5133013d
2 changed files with 25 additions and 25 deletions

View File

@ -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 为分隔符将数组转换为字符串
*

View File

@ -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 为分隔符将数组转换为字符串
*