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