I need to split an array of indeterminate size, at the midpoint, into two separate arrays.
The array is generated from a list of strings using ToArray().
<
Why are you passing the UList
as ref? There doesn't appear to be a need for that.
I would use a generic Split
method if I needed to do this:
public void Split(T[] array, out T[] left, out T[] right)
{
left = new T[array.Length / 2];
right = new T[array.Length - left.Length];
Array.Copy(array, left, left.Length);
Array.Copy(array, left.Length, right, 0, right.Length);
}