推荐使用 Classes.ExtractStrings 函数.
function Split(ss,s:string): TStringList;
begin
  Result := TStringList.Create;
  while Pos(s,ss)>0 do
  begin
    Result.Add(Copy(ss,1,Pos(s,ss)-1));
    Delete(ss,1,Pos(s,ss));
  end;
  Result.Add(ss);
end;


先谢谢 "tomzw" 朋友发现这个函数有内存泄露, 重新写了一个:

http://www.cnblogs.com/del/archive/2008/11/27/1342638.html

其实只有要注意释放返回的对象, 是可以避免内存泄露的.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2022-01-02
  • 2021-05-21
  • 2021-07-03
相关资源
相似解决方案