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;
}
Also in C#:
- change z value unity
- external font family uwp c#
- unity html request
- asp net mvc 5 return view from another controller
- How to get the world position of the edge of an object?
- show double in textbox c#
- c# new thread
- c# implement a superclass in subclass
- asp.net core mvc not triggering client side validation
- unity draw wire square
- how to add movement in unity
- c# string replace comma with newline
- asp.net mvc return file
- asp.net core allow all origins
- devexpress objectspace to session
- unitt only 1 number float
- convert array object to int[] c#
- C# how to get public key for InternalsVisibleTo
- c# getter setter
- 2d object look at object
- c# MessageBox
- json ignore property c#
- top down movement unity
- while loop in c#