AI摘要
SplitString函数用于将字符串Source按照分隔符Deli进行分割,返回一个TStringList类型的列表。函数首先创建一个TStringList对象,然后循环查找分隔符,将分割后的字符串添加到列表中。最后,将剩余的字符串添加到列表并返回。
SplitStrin
function SplitString(Source, Deli: string ): TStringList;
var
EndOfCurrentString: byte;
StringList:TStringList;
begin
StringList:=TStringList.Create;
while Pos(Deli, Source)>0 do
begin
EndOfCurrentString := Pos(Deli, Source);
StringList.add(Copy(Source, 1, EndOfCurrentString - 1));
Source := Copy(Source, EndOfCurrentString + length(Deli), length(Source) - EndOfCurrentString);
end;
Result := StringList;
StringList.Add(source);
end;