Hi all
I have two similar code below:
public class Test {
public static void main(String[] args) {
String ip = "192,168,30,153";//comma
String[] ss = ip.split(","); //it's comma
for(String s:ss){
System.out.println(s);
}
}
}
the result is :
192
168
30
153
but when it changs to period nothing printed.
public class Test {
public static void main(String[] args) {
String ip = "192.168.30.153";//period
String[] ss = ip.split("."); //it's period
for(String s:ss){
System.out.println(s);
}
}
}
thanks