/**
* 将List元素拼装成逗号分隔的字符串
*/
public static String list2String(List<String> arr){
StringBuilder sb = new StringBuilder();
for(Object obj : arr){
sb.append(obj).append(",");
}
return sb.deleteCharAt(sb.length() - 1).toString();
}
public StringBuilder deleteCharAt(int index) {
super.deleteCharAt(index);
return this;
}
public AbstractStringBuilder deleteCharAt(int index) {
if ((index < 0) || (index >= count))
throw new StringIndexOutOfBoundsException(index);
System.arraycopy(value, index+1, value, index, count-index-1);
count--;
return this;
}
public static native void arraycopy(Object src,int srcPos,Object dest,int destPos,int length);
将List元素拼装成逗号分隔的字符串
最新推荐文章于 2023-03-08 20:18:35 发布