String s = "I like an orange as well as apple but mostly apple. apple, orange are the best fruits.";
String[] delimiter = {"orange", "apple"};
I wanted to split this string like below:
{"I like an ", "orange", " as well as ", "apple", " but mostly ", "apple", ".", "apple", ",", "orange", " are the best fruits."}
In above, I have split the string based on the fruit orange and apple, but both the fruits are also the part of list of substring.