D7, classes tstrings 没有strictdelimiter属性,在string转tstrings时,不能分别字符串带空格的情况,
View Code
function StrToStrs(s: string ,cp:chr, rs_s:^TStrings);Var T : integer; begin T : = 1 ; While True do begin if PosEx(cp,s,T) = 0 then begin rs_s.Add(Midstr(s,T,Length(s) - T + 1 )); Break; end ; rs_s.Add(Midstr(s,T,(PosEx(cp,s,T)) - T)); T : = PosEx( ' ~ ' ,s,T); Inc(T); end ;