Horje
non null array length Code Example
non null array length
public static <T> int getLength(T[] arr){
    int count = 0;
    for(T el : arr)
        if (el != null)
            ++count;
    return count;
}

// equivalently in pure C# :
public static int getUsedLength(string[] arr)
        {
            int count = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] != null)
                { 
                    ++count; 
                }
            }
            return count;
        }




Csharp

Related
getcomponent Code Example getcomponent Code Example
web.config customerrors not working Code Example web.config customerrors not working Code Example
c# check if pdf is protected without password Code Example c# check if pdf is protected without password Code Example
asp zero create feature Code Example asp zero create feature Code Example
unity check if animator has parameter Code Example unity check if animator has parameter Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10