Example #1
0
        /// <summary>
        /// Clears the hash set and sets its contents to the unique characters from the <see cref="IEnumerable{T}"/> of <see cref="char"/>.
        /// </summary>
        /// <param name="hashSet">The hash set.</param>
        /// <param name="charEnumerable">The characters to add to the hash set.</param>
        public static void FromCharArray(this HashSet <char> hashSet, IEnumerable <char> charEnumerable)
        {
            if (hashSet == null)
            {
                return;
            }

            if (charEnumerable == null)
            {
                return;
            }

            hashSet.Clear();
            hashSet.AddCharArray(charEnumerable);
        }