foreach (Match m in mc) { if (m.Groups[1].Value.Trim().Contains(" ")) { string[] arr = m.Groups[1].Value.Split(' '); foreach (string s in arr) if (!clsList.Contains(s)) clsList.Add(s); } else if (!clsList.Contains(m.Groups[1].Value)) clsList.Add(m.Groups[1].Value); }
clsList = mc.OfType<Match>().SelectMany(m => m.Groups[1].Value.Split(' ')).Distinct().ToList();
mc.OfType<Match>().ToList().ForEach(m => { clsList.AddRange(m.Groups[1].Value.Split(' ')); }); clsList = clsList.Distinct().ToList();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)