将数组里的元素转换为以逗号分隔的字符串

Integer[] arr = {1,2,3,4,5};
String str = "";
for (Integer i : arr) {
    str += i+",";
}
str = str.substring(0,str.length()-1);
System.out.println(str);
原文地址:https://www.cnblogs.com/lxcmyf/p/6733917.html