Split.java:
public class Split { private static String[] p; public static void main(String[] args){ p = "168.1.12.25".split("\."); System.out.println(p[0]); System.out.println(p[1]); System.out.println(p[2]); System.out.println(p[3]); } }
打印输出为:
168
1
12
25