System.SysUtils.TStringHelper.CopyTo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure CopyTo(SourceIndex: Integer; var destination: array of Char; DestinationIndex: Integer; Count: Integer);

Properties

Type Visibility Source Unit Parent
procedure public System.SysUtils.pas System.SysUtils TStringHelper

Description

Copies memory allocated for several characters in the string to the memory allocated for characters in another string.

CopyTo function is similar to Move function.

var
  MyString, CopyString: String;

begin
  MyString := 'This is a string.';
  CopyString := 'S';
  CopyString.CopyTo(0, MyString[11], 0, CopyString.Length);
  Writeln(MyString);
end.

Output:

This is a String.

See Also