using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DSWeb.Common.Helper { public static class MailAddrSplitDistinctHelper { public static List SplitDistinct(List list) { HashSet hs = new HashSet(); foreach (var item in list) { if (item.Contains(";")) { var arr = item.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var ss in arr) { hs.Add(ss); } } else if (item.Contains(",")) { var arr = item.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var ss in arr) { hs.Add(ss); } } else { hs.Add(item); } } return hs.ToList(); } } }