TString 的 StrictDelimiter
Delphi7 没有发现, 在2009,2010 下都有这个属性.
官方文档的意思是:
Description
Use this property to specify whether the Delimiter is the only value used within the DelimitedText property.
If set to True, individual strings in DelimitedText are separated only by the character that is the value of Delimiter.
If set to False, individual strings in DelimitedText can be separated by a space, a non-printable character,
or the character that is the value of Delimiter.
如果设置了:
StrictDelimiter := True 将严格按照预先设定的分隔符去分隔字符.
反之将会使用设定分隔符,空格,tab. 之类不可见的字符同时对字符做分隔
通常对字符串进行分隔:
function ParseLine(vStr : String;Delimiter:char) : TStringList;
begin
Result := TStringList.Create;
result.StrictDelimiter := True;
Result.CommaText := vStr;
end;

浙公网安备 33010602011771号