help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

Insert

Insert one string in another.

Declaration

Source position: line 0

procedure Insert(

  const source: shortstring;

  var s: shortstring;

  index: SizeInt

);

procedure Insert(

  source: Char;

  var s: shortstring;

  index: SizeInt

);

procedure Insert(

  const Source: AnsiString;

  var S: AnsiString;

  Index: SizeInt

);

procedure Insert(

  const Source: WideString;

  var S: WideString;

  Index: SizeInt

);

Description

Insert inserts string Source in string S, at position Index, shifting all characters after Index to the right. The resulting string is truncated at 255 characters, if needed. (i.e. for shortstrings)

Errors

None.

See also

Delete

  

Delete part of a string.

Copy

  

Copy part of a string.

Pos

  

Search for substring in a string.

Example

Program Example33;

{ Program to demonstrate the Insert function. }

Var S : String;

begin
  S:='Free Pascal is difficult to use !';
  Insert ('NOT ',S,pos('difficult',S));
  writeln (s);
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505