I need to split a string in this form
[delimA][delimB]\n1delimA2delimB3
for example if I have
[***][%]\n1***2%3
it should return an array of
1 2 3
How can I do this?
I need to split a string in this form
[delimA][delimB]\n1delimA2delimB3
for example if I have
[***][%]\n1***2%3
it should return an array of
1 2 3
How can I do this?
You don't need a regular expression for this. String.Split can accept multiple delimiters, eg :
var line="[***][%%]";
var parts=.Split(new[]{'[',']'},StringSplitOptions.RemoveEmptyEntries);
StringSplitOptions.RemoveEmptyEntries as the name explains, will remove any empty entries after splitting