Variant.strv
Description:
Constructs an array of strings Variant from the given array of strings.
If length
is -1 then strv
is null-terminated.
Example: Create a new string[] Variant:
public static int main () {
Variant var1 = new Variant.strv ({"a", "b", "c"});
// Output: ``a,b,c``
print ("%s\n", string.joinv (",", var1.dup_strv ()));
// Output: ``a,b,c``
print ("%s\n", string.joinv (",", var1.get_strv ()));
// Output: ``a,b,c``
print ("%s\n", string.joinv (",", (string[]) var1));
return 0;
}
valac --pkg glib-2.0 GLib.Variant.Variant.strv.vala
Parameters:
length |
the length of |
strv |
an array of strings |
Returns:
a new floating Variant instance |