Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string sample = "1a2b3c4d";
- MatchCollection matches = Regex.Matches(sample, @"d");
- List<string> matchesList = new List<string>();
- foreach (Match match in matches)
- matchesList.Add(match.Value);
- matchesList.ForEach(Console.WriteLine);
- List<string> matchesList2 = new List<string>();
- matchesList2.AddRange(
- from Match match in matches
- select match.Value
- );
- matchesList2.ForEach(Console.WriteLine);
Add Comment
Please, Sign In to add comment