添加定界符: AnsiQuotedStr

var
ss,s: AnsiString;
begin
ss :
= 'Hello';

s :
= AnsiQuotedStr(ss, '"'); {参数2是定界符, Char 类型}
ShowMessage(s);
{"Hello"}

s :
= AnsiQuotedStr(ss, '#');
ShowMessage(s);
{#Hello#}

ss :
= 'Hello#Hello'; {如果中间包含要添加的定界符, 将被双写}
s :
= AnsiQuotedStr(ss, '#');
ShowMessage(s);
{#Hello##Hello#}
end;
posted @ 2011-06-12 17:01  瓜蛋  阅读(397)  评论(0编辑  收藏  举报