delphi将字符串转换成stringlist
function StrToList(const sString, Token: string): TStringList;
var
sTmp: string;
iPos: Integer;
Toklen: Integer;
begin
Toklen := Length(Token);
Result := TStringList.Create;
sTmp := sString;
iPos := Pos(Token, sTmp);
while iPos <> 0 do
begin
Result.Add(Copy(sTmp, 1, iPos - 1));
Delete(sTmp, 1, iPos - 1 + Toklen);
iPos := Pos(Token, sTmp);
end;
Result.Add(sTmp);
end;
你今天的努力,只是为了让你的苦更有价值