CSharp examples for System.Collections.Generic:List
sub List from to
using System.Collections; using System;/* w ww . ja va 2 s .com*/ public class Main{ public static IList subList(IList list, int from, int to) { IList newList = new ArrayList(); for (int i = from; i < to; i++) newList.Add(list[i]); return newList; } public static bool add(ICollection list, object value) { if (!((IList) list).Contains(value)) { ((IList) list).Add(value); return true; } else return false; } }