Str.strcanon

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

class Str
static
string
strcanon
(
string string
,
string validChars
,)

Parameters

string string

a nul-terminated array of bytes

validChars string

bytes permitted in string

substitutor char

replacement character for disallowed bytes

Return Value

Type: string

string

Meta