1. 程式人生 > >將字串中的數字轉化為文字

將字串中的數字轉化為文字

   String ids = "1,2,3";
String[] industryIdsArr = ids.split(",");
String str = "";
if (industryIdsArr != null && industryIdsArr.length > 0) {
for (int i = 0; i < industryIdsArr.length; i++) {
str += 1 + ",";
}
}
str = str.substring(0, str.length() - 1);
System.out.println(str);
}