Alex Rivera | Logout

In Delphi 7, how do I escape a percent sign (%) in the Format function?

Asked 2008-11-06T02:33:40.990
25

I want to do something like this:

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

But Format doesn't like that last '%', of course. So how can I escape it? \%? %%?

Or do I have to do this:

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

?

Edit
Report

1 Answer

8

%% , IIRC.

answered 2008-11-06T02:40:56.030

Your Answer