CSharp examples for System.Collections.Generic:IList
Swap value in IList
using System.Collections.Generic; using System;/*from w ww . j a v a 2 s . c om*/ public class Main{ public static void Swap<T>(IList<T> array, int firstIndex, int secondIndex) where T: struct { T temp = array[firstIndex]; array[firstIndex] = array[secondIndex]; array[secondIndex] = temp; } }