canon


Description:

public void canon (string valid_chars, char substitutor)

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", '?'))

Parameters:

valid_chars

bytes permitted in string

substitutor

replacement character for disallowed bytes

string

a nul-terminated array of bytes

Returns:

string