Sign in Join
FPDoc Onlineexperiment

QuotedStr function

In unit sysutils

Return a quotes version of a string.

Declaration

pascal
function QuotedStr(const S: string): string

Description

QuotedStr returns the string S, quoted with single quotes. This means that S is enclosed in single quotes, and every single quote in S is doubled. It is equivalent to a call to AnsiQuotedStr(s, '''').

Errors

None.

See also

Example: ex78

pascal
Program Example78;

{ This program demonstrates the QuotedStr function }

Uses sysutils;

Var S : AnsiString;

Begin
  S:='He said ''Hello'' and walked on';
  Writeln (S);
  Writeln ('  becomes');
  Writeln (QuotedStr(S));
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.