在做各种字符串封装的时候,不免用循环拼装字符串,如下:String[]idArr={"tom","cat","jim","jone"};StringBuffersBuffer=newStringBuffer();for(inti=0;i<idArr.length;i++){sBuffer.append(idArr[i]);sBuffer.append(",");}现在sBuffer.toString()的值是:tom,cat,jim,jone,最后想要的结果是tom,cat,jim...
查看全文