str_replace


Description:


[ Version ( since = "4.17" ) ]
public string? str_replace (string str, string pattern, string replacement)

Searches str for occurances of pattern and replaces each such occurance with replacement.

Returns a newly allocated copy of str on which the given replacement were performed. The caller is responsible to free the returned string using g_free when no longer needed.

Note that pattern and replacement don't need to be of the same size. If replacement is null, the pattern will be removed from the string.

Note for future Xfce developers: Deprecate this function when replace is available. (Added since Glib >= 2.68)

Parameters:

str

the input string.

pattern

a search pattern in str.

replacement

replacement string for pattern.

Returns:

a newly allocated copy of str where all occurrences of pattern are replaced with replacement . Or null if str is null.


Namespace: Xfce