Getting count of elements in an array C# script
I'm not sure what I'm doing wrong with this but I can't seem to find the way to get number of elements in an array. I'm using C# script.
Here's what I'm trying to do basically
<font class="small">Code:</font><hr /><pre>
myArr = new Array("Ele1", "Ele2", "Ele3");
Log["Message"](myArr["Count"]); // should enter a log entry "3"
Anyone got an idea on what I'm doing wrong?
Re: Getting count of elements in an array C# script
You need to use the length property (myArr["lenght"]). Information on JScript/C++Script/C#Script arrays can be found here.