Description |
The Source string object is copied to the target (result) string. The target is a new string rather than a reference to the original string. This means that any updates to the original source string are isolated to that string.
|
|
Microsoft MSDN Links |
system
system.String
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
strA, strB : String;
begin
strA := 'First';
strB := 'Second';
Console.WriteLine('Before copy');
Console.WriteLine('strA = ' + strA);
Console.WriteLine('strB = ' + strB);
strB := System.String.Copy(strA);
Console.WriteLine('After copy of strA to strB');
Console.WriteLine('strA = ' + strA);
Console.WriteLine('strB = ' + strB);
strA := 'First updated';
Console.WriteLine('After update of strA');
Console.WriteLine('strA = ' + strA);
Console.WriteLine('strB = ' + strB);
Console.ReadLine;
end.
| Show full unit code | Before copy
strA = First
strB = Second
After copy of strA to strB
strA = First
strB = First
After update of strA
strA = First updated
strB = First
|
|
|
|