我正試圖在Java中實現這樣的場景。需要對字符串值進行排序,同時忽略對空字符串值的任何位置更改
我有一個ArrayList
["23","5","","","54","20","","","","0"]`
目前,該列表是沒有排序,我想它的方式,空字符串""
的位置保持排序。
這意味着空字符串不排序,其他值是。 實施例 的ArrayList
["0","5","","","20","23","","","","54"].
注意,空字符串(最初在位置2,3 & 6,7,8)的位置被保持之後和分類僅與非空值來實現。我使用Java,我真的很想有一些想法來開始實現這個要求。我曾嘗試谷歌,但無法找到一個開始就此。
請幫忙,
在此先感謝。
發佈您嘗試過的代碼。 – theGreenCabbage 2014-11-25 09:58:18