如下 String s1 = "www.bilibili.com"; String[] s2 = s1.spilt("\\."); System.out.println(Arrays.toString(s2)); 注意加转义字符。