Function

Purplestrreplace

since: 2.0

Declaration [src]

gchar*
purple_strreplace (
  const char* string,
  const char* delimiter,
  const char* replacement
)

Description [src]

Given a string, this replaces one substring with another and returns a newly allocated string.

Available since: 2.0

Parameters

string

Type: const char*

The string from which to replace stuff.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
delimiter

Type: const char*

The substring you want replaced.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
replacement

Type: const char*

The substring you want inserted in place of the delimiting substring.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gchar*

A new string, after performing the substitution. free this with g_free().

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.