CSharp examples for System.Collections.Generic:IEnumerable
Returns all the elements but the first
using System.Linq; using System.Collections.Generic; public class Main{ /// <summary> /// Returns all the elements but the first /// </summary> /// <typeparam name="T">Type of the collection</typeparam> /// <param name="sequence">Collection to use</param> /// <returns>result = collection@pre->at( 1, length - 1)</returns> public static IEnumerable<T> Tail<T>(this IEnumerable<T> sequence) {//from w w w . j av a 2s . co m return sequence.Skip(1); } }