예제 #1
0
        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);
        }
예제 #2
0
        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);
        }