[ 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.
The returned string should be freed with g_free.
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
separator |
a string to insert between each of the strings, or null |
... |
a null-terminated list of strings to join |
a newly-allocated string containing all of the strings joined together, with |