+ 1
A multi split with brackets question
I have a string and I want to splits these signs .,:[] I like to know how to split multiple delimiters together with the brackets? String splitme = "mom.girl, dad:boy [ girl, aunt ] granny"; I know how to do it without a [ "brackets" if that what's it called. splitme.split("[.,:]");
2 Answers
+ 4
.....
try
splitme.split("\\.|\\,|\\[|\\]|:");
+ 1
apparently this option also works when I splitme.split([,.:\\[\\]]); but I will give you the best answer