I got this simple code:
String ip = \"1.2.3.4\";
String[] ipArray = ip.split(\".\");
System.out.println(ipArray[1]);
And ipArray
Use ip.split("\\."); and your problems will be solved. The problem is that String#split receives a regular expression, the dot (.) symbol is a special character in regular expressions, so you need to escape it for it to be interpreted as a plain dot, also as the backslash is an escape character in Java, you have to escape it too.