在Delphi 7中,如何在Format函数中转义百分号(%)?

Blo*_*ard 17 delphi format escaping delphi-7

我想做这样的事情:

SQL.Text := Format('select foo from bar where baz like ''%s%''',[SearchTerm]);
Run Code Online (Sandbox Code Playgroud)

但格式当然不喜欢最后的'%'.那我该怎么逃避呢?\%%%

或者我必须这样做:

SQL.Text := Format('select foo from bar where baz like ''%s''',[SearchTerm+'%']);
Run Code Online (Sandbox Code Playgroud)

Rob*_*ble 29

在格式字符串中使用另一个%:

SQL.Text := Format('select foo from bar where baz like ''%s%%''',[SearchTerm]);
Run Code Online (Sandbox Code Playgroud)


moo*_*baa 6

%%,IIRC.