Description |
Copies Count characters from the string object, starting at SourceStart to Target array of characters, from position TargetStart.
|
| Notes | Very Important : Methods in .Net treat strings as starting at 0, unlike traditional Delphi where they started at 1.
|
|
Microsoft MSDN Links |
system
system.String
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
source : String;
target : Array[1..12] of char;
i : Integer;
begin
source := '012345678';
for i := 1 to 12 do
target[i] := '-';
Console.WriteLine('Before CopyTo');
Console.WriteLine('source = ' + source);
Console.WriteLine('target = ' + target);
source.CopyTo(3, target, 5, 4);
Console.WriteLine('After CopyTo');
Console.WriteLine('source = ' + source);
Console.WriteLine('target = ' + target);
Console.ReadLine;
end.
| Show full unit code | Before CopyTo
source = 0123456789
target = ------------
After CopyTo
source = 0123456789
target = -----3456---
|
|
|
|