I need to implement the Array.Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) in a function.
The array it gets is a char[] array here is my implementation but it doesn't work:
private char[] ArrayCopier(char[] chars, int startIndex, int length)
{
char[] NewArray = new char[length];
int index = 0;
for (int i = startIndex; i < length; i++)
{
NewArray[index] = chars[i];
}
return NewArray;
}
indexcounter.i < (length + startIndex).