Swap values - CSharp System

CSharp examples for System:Array Element

Description

Swap values

Demo Code


using System.Collections.Generic;
using System.Collections;
using System;//  ww w.  ja v a2 s. com

public class Main{
        public static void Swap<T>(ref T a, ref T b)
        {
            T c = a;
            b = a;
            a = c;
        }
}

Related Tutorials