ios數組轉字符串方法?1.将集合轉成String字符串2.将數組轉成String字符串,今天小編就來說說關于ios數組轉字符串方法?下面更多詳細答案一起來看看吧!
1.将集合轉成String字符串
String s=";for (int i = 0; i < numList.size; i++) { if (s==") { s=numList.get(i); }else { s=s+","+numList.get(i); }}List<String> numList=new ArrayList<String>;for(int i=1; i<10; i++){ numList.add(String.valueOf(i)); }
2.将數組轉成String字符串
String arr = {"abc", "123", "@#&"}; StringBuffer sb = new StringBuffer; for(int i = 0; i < arr.length; i++){ sb. append(arr[i]); } String ns = sb.toString; System.out.println(ns); }
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!