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

Delete

Delete part of a string.

Declaration

Source position: systemh.inc line 1080

procedure Delete(

  var s: shortstring;

  index: SizeInt;

  count: SizeInt

);

procedure Delete(

  var S: RawByteString;

  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 deleted characters are shifted Count positions to the left, and the length of the string is adjusted.

Errors

Shortstring variant's third parameter is called Count, in other overloaded variants it is called Index

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.

Documentation generated on: Nov 16 2015