I\'m having a string like
\"List_1 fooo asdf List_2 bar fdsa XList_3 fooo bar\"
and a List
like
You could do something like below:
string sampleStr = "List_1 fooo asdf List_2 bar fdsa XList_3 fooo bar";
string[] splitStr =
sampleStr.Split(l_lstValues.ToArray(), StringSplitOptions.RemoveEmptyEntries);
EDIT: Modified to print the fragments with list word as well
Assumption: There is no ':
' in sampleStr
foreach(string listWord in l_lstValues)
{
sampleStr = sampleStr.Replace(listWord, ':'+listWord);
}
string[] fragments = sampleStr.Split(':');