ExceptWith removes the specified elements from the source set.
Here, we strip all vowels from the set:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class Sample
{
public static void Main()
{
var letters = new HashSet<char>("the quick brown fox");
letters.ExceptWith("aeiou");
foreach (char c in letters)
Console.Write(c);
}
}
The output:
th qckbrwnfx
| www.__j_a___v___a__2_s___.c___o__m__ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |