Function

GLibstrjoinv

Declaration [src]

gchar*
g_strjoinv (
  const gchar* separator,
  gchar** str_array
)

Description [src]

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

If str_array has no items, the return value will be an empty string. If str_array contains a single item, separator will not appear in the resulting string.

Parameters

separator

Type: const gchar*

A string to insert between each of the strings.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
str_array

Type: An array of gchar*

An array of strings to join.

The array must be NULL-terminated.
The data is owned by the caller of the function.
Each element is a NUL terminated UTF-8 string.

Return value

Type: gchar*

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

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.