下面是个简单易学的delphi中的split函数教程,图老师小编详细图解介绍包你轻松学会,喜欢的朋友赶紧get起来吧!
【 tulaoshi.com - 编程语言 】
  //根据字符串,拆分字符串,相当于vb中的split函数
  function SplitString(const Source,ch:string):TStringList;
  var
    temp:String;
    i:Integer;
  begin
    Result:=TStringList.Create;
    //如果是空自符串则返回空列表
    if Source=''
    then exit;
    temp:=Source;
    i:=pos(ch,Source);
    while i0 do
    begin
       Result.add(copy(temp,0,i-1));
       Delete(temp,1,i);
       i:=pos(ch,temp);
    end;
    Result.add(temp);
  end;
www.sinoprise.com
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)来源:http://www.tulaoshi.com/n/20160219/1601865.html
看过《delphi中的split函数》的人还看了以下文章 更多>>