Thursday, May 5, 2011

Split a string with "." as a delimiter in Java

Another typical error that most of us make while splitting a string with "." as a delimiter, is not escaping it.


String unsplitString = "abc.def.xyz";
String[] splitStrings = unsplitString.split ("\\.");

No comments: