SplitString分隔函数

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;

Posted in 软件开发 by 傻猫 at May 27, 2006.
Tags: 函数

添加新评论