[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

Delete

Delete part of a string.

Declaration

Source position: line 0

procedure Delete(

  var s: shortstring;

  index: SizeInt;

  count: SizeInt

);

procedure Delete(

  var S: AnsiString;

  Index: SizeInt;

  Size: SizeInt

);

procedure Delete(

  var S: UnicodeString;

  Index: SizeInt;

  Size: SizeInt

);

procedure Delete(

  var S: WideString;

  Index: SizeInt;

  Size: SizeInt

);

Description

Delete removes Count characters from string S, starting at position Index. All characters after the delected characters are shifted Count positions to the left, and the length of the string is adjusted.

Errors

None.

See also

Copy

  

Copy part of a string.

Pos

  

Search for substring in a string.

Insert

  

Insert one string in another.

Example

Program Example15;

{ Program to demonstrate the Delete function. }

Var
  S : String;

begin
  S:='This is not easy !';
  Delete (S,9,4); { S:='This is easy !' }
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.