IEnumerable with a foreach loop : IEnumerable : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » IEnumerable »

 

IEnumerable with a foreach loop








    
 

using System;
using System.Collections.Generic;
using System.Linq;
public class MainClass {
    public static void Main() {

        IEnumerable<char> query = "Not what you might expect";

        foreach (char vowel in "aeiou")
            query = query.Where(c => c != vowel);

        foreach (char c in query) Console.Write(c); 
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» IEnumerable