Reputation: 503
How can I find a string between repeated strings? For example, if
string str = @"||AAA||BBB||CCC||";
how can I find all the strings(AAA, BBB, CCC) in order between repeated strings(||)?
Upvotes: 0
Views: 53
Reputation: 13652
Just use String.Split
:
var str = @"||AAA||BBB||CCC||";
var splits = str.Split(new string[] {"||"}, StringSplitOptions.RemoveEmptyEntries);
Upvotes: 4