Swap element in IList - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:IList

Description

Swap element in IList

Demo Code


using System.Security.Cryptography;
using System.Collections;
using System;/*www  .ja  v  a  2s.co  m*/

public class Main{
        public static void Swap(IList list, int i, int i1) {
         object value1 = list[i];
         object value2 = list[i1];
         list[i] = value2;
         list[i1] = value1;
      }
}

Related Tutorials