replaceChar

replaceChar(char:     Character;
            withChar: Character): updating;

The replaceChar method of the StringUtf8 primitive type replaces all occurrences of the character specified in the char parameter with the character specified in the withChar parameter.

The character replacement is case-sensitive.

The following example shows the use of the replaceChar method.

vars
    str8 : StringUtf8;
begin
    str8 := "zhis example shows character replacement";
    write str8;  // Outputs: zhis example shows character replacement
    str8.replaceChar("z", "T");
    write str8;  // Outputs: This example shows character replacement
end;