Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

Double quote a string that has spaces

  temp_str: String;
{ double quote a string that has spaces }
if StrScan(PChar(temp_str), Chr($20)) <> nil then 
  temp_str := AnsiQuotedStr(temp_str, Chr($22));

$20 is the the space character; $22 is the double-quote character.

I know that QuoteSpacedString in the Code Snippets Databasedoes the same thing. The above if statement may be faster for strings that can only have $20 as a white space character such as a file path.

Tested on RAD Studio XE3.

Author: Don Rowlett
Contributor: Don Rowlett
Added: 2013-07-30
Last updated: 2013-07-30

« Return to contents »