- Sep 10, 2001
- 11,711
- 8
- 81
How do you split on a period (".") ?
I have the String "1.2.3" and want to split on the period.
Doing: String s[] = "1.2.3".split(".")
does not work, returns empty array. I assume it's because the period is part of regular expression syntax (I think it indicates all?). Is there an escape character in regex so I can use the period?
I have the String "1.2.3" and want to split on the period.
Doing: String s[] = "1.2.3".split(".")
does not work, returns empty array. I assume it's because the period is part of regular expression syntax (I think it indicates all?). Is there an escape character in regex so I can use the period?