concat


Description:

[ CCode ( cname = "g_strconcat" ) ]
public string concat (string string2, ...)

Concatenates all of the given strings into one long string.

The variable argument list must end with `NULL`. If you forget the `NULL`, `g_strconcat()` will start appending random memory junk to your string.

Note that this function is usually not the right function to use to assemble a translated message from pieces, since proper translation often requires the pieces to be reordered.

Example: Concatenate given strings:

public static int main (string[] args) {
// Output: ``Affirmative, Master.``
string res = "Affirmative".concat (", ", "Master", ".");
print ("%s\n", res);
return 0;
}

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

Parameters:

...

a `NULL`-terminated list of strings to append to the string

string1

the first string to add, which must not be `NULL`

Returns:

a newly-allocated string containing all the string arguments