CSharp examples for System.Collections:ICollection
Map value in ICollection
// Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; public class Main{ // Name needs to be different so it doesn't conflict with Enumerable.Select public static U[] Map<T, U>(this ICollection<T> collection, Func<T, U> select) {/*from w w w . j a v a2s. co m*/ int count = collection.Count; U[] result = new U[count]; count = 0; foreach (T t in collection) { result[count++] = select(t); } return result; } }