Re: [Vala] array size determining? how to
- From: Evan Nemerson <evan coeus-group com>
- To: Charles Hixson <charleshixsn earthlink net>
- Cc: vala-list gnome org
- Subject: Re: [Vala] array size determining? how to
- Date: Sat, 18 Sep 2010 15:05:21 -0700
On Sat, 2010-09-18 at 14:09 -0700, Charles Hixson wrote:
When an array is passed back from a library routine, say string split,
how does one determine the number of elements?
Arrays have a length member which will generally give you what you want.
For example:
var arr = "one,two,three".split (",");
GLib.debug ("Elements: %d", arr.length);
There is some good information in the Arrays section of the tutorial:
http://live.gnome.org/Vala/Tutorial#Arrays
-Evan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]