Function
GLibstrcanon
since: 2.0
Description
For each character in string, if the character is not in valid_chars,
replaces the character with substitutor.
Modifies string in place, and return string itself, not a copy. The
return value is to allow nesting such as:
g_ascii_strup (g_strcanon (str, "abc", '?'))
In order to modify a copy, you may use g_strdup():
reformatted = g_strcanon (g_strdup (const_str), "abc", '?');
…
g_free (reformatted);
Available since: 2.0
Parameters
string-
Type:
gchar*A nul-terminated array of bytes.
The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. valid_chars-
Type:
const gchar*Bytes permitted in
string.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. substitutor-
Type:
gcharReplacement character for disallowed bytes.