Return a clone of the given char array. No null checks are performed. - CSharp System

CSharp examples for System:Char

Description

Return a clone of the given char array. No null checks are performed.

Demo Code


using System;/* w  ww . j a v a 2 s  .c om*/

public class Main{
        /// <summary>
        /// Return a clone of the given char array. No null checks are performed.
        /// </summary>
        /// 
        /// <param name="A">The array to clone</param>
        /// 
        /// <returns>The clone of the given array</returns>
        public static char[] Clone(char[] A)
        {
            char[] result = new char[A.Length];
            Array.Copy(A, 0, result, 0, A.Length);

            return result;
        }
}

Related Tutorials