Function

Purplestrreplace

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.

Parameters

string 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 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 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

Returns: 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.