如何添加所有charAcro []來創建一個字符串?例如 charAcro [0] = A,charAcro [1] = B,charAcro [2] = C,這使得該串ABC附加char數組創建字符串
while(resultSet.next()){
String Name = rs.getString(1);
String Acro=Name;
String delimiterAcro = " ";
String[] temp =null;
char[] charAcro = null;
temp = Name.split(delimiterAcro);
for(int i = 0;i<temp.length;++i){
charAcro[i] = temp[i].charAt(0);
//SOME CODE HERE?
}
}
我回敬一個StringBuilder的,但是這是一個更好的解決方案。榮譽。 –
感謝您編輯我的文章....但現在它看起來不像我的文章... – mkoryak