I have a string like this:
string subjectString = "one two \"three four\" five \"six seven\"";
and I want to transform it into a StringCollection like this:
- one
- two
- three four
- five
- six seven
Is there a way how to achieve this using a Regex class in asp.net C# 2.0, somehow like this way?
string subjectString = "one two \"three four\" five \"six seven\"";
System.Collections.Specialized.StringCollection stringCollection = new System.Collections.Specialized.StringCollection();
foreach (System.Text.RegularExpressions.Match match in System.Text.RegularExpressions.Regex.Matches(subjectString, "some_regex_here"))
{
stringCollection.Add(match.Value);
}