CSharp examples for System.Collections:IEnumerable
Convert IEnumerable from one type to another generic type
// The MIT License using System.Text; using System.Collections.Generic; using System;// ww w .j av a2 s . c o m public class Main{ public static IEnumerable<TOutput> Convert<TInput, TOutput>(IEnumerable<TInput> input, Converter<TInput, TOutput> converter) { foreach(TInput inputValue in input) yield return converter(inputValue); } }