ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Zero Index CopyTo

CopyTo without the second parameter, for when you just want to copy array A to array B verbatim and size is not a concern.

Source

public static void CopyTo<T>(this T[] array, T[] target)
{
    array.CopyTo(target, 0);
}

Example

array.CopyTo(target);   // no index argument required

Author: Benedict Tough

Submitted on: 10 jul. 2017

Language: C#

Type: T[]

Views: 3020