Re: [Vala] Is this a bug in VALA ?



Hi,

you might want to use one of these functions:

http://references.valadoc.org/glib-2.0/string.split.html
http://references.valadoc.org/glib-2.0/string.split_set.html

For example:

void main () {
        string line = "happy doggy";
        string[] tokens = line.split (" ");
        assert (tokens.length >= 2);
        string col1 = tokens[0];
        string col2 = tokens[1];
        stdout.printf ("col1: %s, col2: %s\n", col1, col2);
}


Best regards,

Frederik



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