0
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.

Hank
  • 9
  • 2

1 Answers1

3

. is wildcard character in regex.

use - split("\\.")

Raman Shrivastava
  • 2,923
  • 15
  • 26