I want to split a String by dot (".") in Java and I know that the split function of String in Java use regular expression, so I used someString.split("\.")
to escape the special character ".", but it didn't work; I tried someString.split("\\.")
and it worked.
I used split("\t")
before to split String with tab and it worked. Why that it's not necessary to escape the special character '\t'
like split("\\t")
?