Insert

Declaration:
Procedure Insert (Const Source : String;var S : String;Index : Integer);
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 (481), Copy (477), Pos (546)

Listing: refex/ex33.pp


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.