When I perform
String test=\"23x34 \"; String[] array=test.split(\"x\"); //splitting using simple letter
I got two items in array as 23 and
I personally prefer using
String modified = Pattern.compile("x", Pattern.CASE_INSENSITIVE).matcher(stringContents).replaceAll(splitterValue); String[] parts = modified.split(splitterValue);
In this way you can ensure any regex will work, as long as you have a unique splitter value