public static CharacterSet Union(CharacterSet c1, CharacterSet c2) { CharacterSet newSet = new CharacterSet(); foreach (char c in c1.mAllCharacters.Union(c2.mAllCharacters)) { newSet.mAllCharacters.Add(c); } newSet.ComputeRanges(); return(newSet); }
public static CharacterSet Subtract(CharacterSet c1, CharacterSet c2) { CharacterSet newSet = new CharacterSet(); foreach (char c in c1.mAllCharacters) { if (c2.mAllCharacters.Contains(c) == false) { newSet.mAllCharacters.Add(c); } } newSet.ComputeRanges(); return(newSet); }