Description |
Replaces all occurences of a single character, or a sequence of characters : OldValue with a new character or string : NewValue in the current string.
It is a case sensitive method.
|
| Notes | Like a lot of string methods, the string object itself is not affected - the modified string is returned for assignment.
|
|
Microsoft MSDN Links |
system
system.String
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
strA, strB : String;
begin
strA := 'First is not worst';
strB := strA.Replace('rst', 'rm');
Console.WriteLine('strA = ' + strA);
Console.WriteLine('Replacing ''rst'' with ''rm''');
Console.WriteLine('strB = ' + strB);
Console.ReadLine;
end.
| Show full unit code | strA = First is not worst
Replacing 'rst' with 'rm'
strB = Firm is not worm
|
|
|
|