[Java] 陣列與字串轉換,Array to String 和 String to Array
String to Array 字串切割成字元 String s="LLLRRR"; String [] arrs=s.split(""); System.out.println(arrs); 字串以空白鍵區隔 String s2="I like dog!"; String [] arrs2=s.split(" "); System.out.println(arrs); Array to String String Shuffle_String=""; String maparrs = new String[]{ [l, e, e, t, c, o, d, e]}; for(int i = 0; i<maparrs.length;i++ ){ Shuffle_String+=maparrs[i]; }