String.replaceAll("網際網路", "Internet")
用于字元串替換 replaceAll(“需要替換的字元串”,“替換成的字元串”)
String.split(",|。");
字元串分割 ()内注意:符号的中英文,不能有空格,多字元串分割用一個引号 中間用|隔開
将分割的結果存入List并單獨成行
Set<String> set = new TreeSet<String>();
for (int i = 0; i < strs.length; i++) {
set.add(strs[i]);
}
for (String t : set) {
System.out.print(t + "\n ");
}