Substr.AnsiQuotedStr Method

function AnsiQuotedStr(const S: Substring; const Quote: Char): Substring; overload; inline;

S in Quote, every Quote inside doubled.

#NameTypeDescription
1SSubstring
2QuoteChar

Returns: Substring

Remarks:

An embedded #0 is a character: the Quotes after it are doubled too.

Examples

Quoting with a double quote.

uses Substr;

procedure Example;
begin
    Assert(AnsiQuotedStr(Substring('a"b'), '"') = '"a""b"');
end;