1. 程式人生 > >將輸入的字串轉為char字元陣列

將輸入的字串轉為char字元陣列

Scanner sc = new Scanner(System.in);
//System.out.print("請輸入字串:");
str = sc.nextLine();
char[] chs = str.toCharArray();