看板 [ java ]
討論串[問題] String的問題
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者kyoby (nothing here)時間17年前 (2008/04/02 15:57), 編輯資訊
0
0
0
內容預覽:
比較簡潔. 不過有個小問題:. 他的題意是要保存字符串加個逗號...你這里只保存了字符串. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 218.108.28.85.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者qrtt1 (Is freelancer free?)時間17年前 (2008/04/02 15:48), 編輯資訊
0
0
0
內容預覽:
和以上二位同樣的概念, 不過自覺得比較好懂的寫法:P. String str = "abc,def,ghi,jkl,mno,";. List<String> list = new ArrayList();. for (String o : str.split("[,]+")) {. if (list
(還有118個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者gotoo (阿拉斯加雙面魚)時間17年前 (2008/04/02 14:19), 編輯資訊
0
0
0
內容預覽:
for(int j=0; j<count; j++) {. for(int k=0; k<j+1; k++) {. if(k != 0) {. second[j] += ("," + first[k]);. } else {. second[j] = first[k];. }. }. }. --.

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者kyoby (nothing here)時間17年前 (2008/04/02 14:13), 編輯資訊
0
0
0
內容預覽:
public static List<String> stringToArrayFantasy(String testStr). {. List destList=new ArrayList<String>();. int startIndex=0;. for (; ; ). {. if(testS
(還有199個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者weichien7110 (^.^)時間17年前 (2008/04/02 13:53), 編輯資訊
0
0
0
內容預覽:
用一個StringBuffer將每次切出來的first array加起來. 最後再把這個buffer的值丟進second array. StringBuffer temp = new StringBuffer(); temp.append(first[i] + ",");. second[i] =
首頁
上一頁
1
2
下一頁
尾頁