replaceChar

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

The replaceChar method of the String 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
    stringValue : String;
begin
    stringValue := "zhis example shows character replacement";
    write stringValue;  // Outputs: zhis example shows character replacement
    stringValue.replaceChar("z", "T");
    write stringValue;  // Outputs: This example shows character replacement
end;