System.out.println(Arrays.toString("1.1.1".split(".")));
This prints out an empty array. What gives? To me, it should print out "[1, 1, 1]". Instead, it prints out "[]". It doesn't make sense to me.
System.out.println(Arrays.toString("1.1.1".split(".")));
This prints out an empty array. What gives? To me, it should print out "[1, 1, 1]". Instead, it prints out "[]". It doesn't make sense to me.
. is wildcard character in regex.
use - split("\\.")