[Vala] How to obtain number of elements in array



Hi,

How do I obtain that the following string array has two elements

        const string[] x = {
                "string1",
                "string2"
        };      

Ofcourse I can do something like

num = 0;

foreach (string y in x) {
   num++;
}
but I'm looking for something to obtain it at once

So something like

num = x.length();

Thanks

Jaap



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]