Let say I have a list of strings like:
List myList = new ArrayList();
myList.add("person [something]");
myList.add("person 'something'");
so in my strings sometimes I have [ and sometimes '
and now I would like to get substrings but I don't know how to do this if I would like to cut my string in one of the two chars. Can anyone tell me whether that option is possible? I tried something like:
List finalOne = new ArrayList();
for(String ss: myList){
finalOne.add(ss.substring("[" || "'" ))
}
I expect to get all substrings starting from char "[" or starting from "'" in one run