Sign in Join
FPDoc Onlineexperiment

AnsiExtractQuotedStr function

In unit sysutils

Removes the first quoted string from a string.

Declaration

pascal
function AnsiExtractQuotedStr(var Src: PAnsiChar; Quote: AnsiChar)
: Ansistring

Description

AnsiExtractQuotedStr returns the first quoted string in Src, and deletes the result from Src. The resulting string has with Quote characters removed from the beginning and end of the string (if they are present), and double Quote characters replaced by a single Quote characters. As such, it reverses the action of AnsiQuotedStr.

Errors

None.

See also

Example: ex51

pascal
Program Example51;
{ This program demonstrates the AnsiQuotedStr function }
Uses sysutils;

Var 
  S : AnsiString;
  P : PChar;

Begin
 S:='He said "Hello" and walked on';
 P:=Pchar(S);
 S:=AnsiQuotedStr(P,'"');
 Writeln (S);
 P:=Pchar(S);
 Writeln(AnsiExtractQuotedStr(P,'"'));
End.

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