c# remove empty elements from array code example
Example 1: delete null elements array c#
Cars = Cars.Where(c => c != null).ToArray();
Example 2: how to empty an array c#
Array.Clear(arr, 0, arr.Length);
Cars = Cars.Where(c => c != null).ToArray();
Array.Clear(arr, 0, arr.Length);