CSharp examples for System:Array Index
Get Free Index from array
using System.Text; using System.Linq; using System.Collections.Generic; using System;/* w w w. j a v a 2s . c o m*/ public class Main{ public static uint GetFreeIndex<T>(this T[] arr) { uint i = 0; for (; i < arr.Length; i++) { if (arr[i] == null || arr[i].Equals(default(T))) { return i; } } return i; } }