join


Description:

[ CCode ( cname = "g_strjoin" ) ]
public static string join (string separator, ...)

Joins a number of strings together to form one long string, with the optional separator inserted between each of them.

Example: Joins a number of strings:

public static int main (string[] args) {
// Output: ``Dalek, Cyberman, Weeping Angel``
string enemies = string.join (", ", "Dalek", "Cyberman", "Weeping Angel");
print ("%s\n", enemies);
return 0;
}

valac --pkg glib-2.0 string.join.vala

Parameters:

separator

a string to insert between each of the strings

...

a `NULL`-terminated list of strings to join

Returns:

a newly-allocated string containing all of the strings joined together, with separator between them