正在阅读:用Delphi实现StringTokenizer功能用Delphi实现StringTokenizer功能

2004-02-14 09:34 出处:CSDN 作者:qs1976 责任编辑:linjixiong
published   { Published declarations }   end;      procedure Register;      implementation      procedure Register;   begin   RegisterComponents('SkyDevKit', [TSkyStringTokenizer]);   end;      { TStringTokenizer }      function TSkyStringTokenizer.hasNext: boolean;   begin   result := (index < tokens.Count - 1);   end;      procedure TSkyStringTokenizer.init(dataLine, delim: string);   begin   tokens := TStringList.Create();   delimiter := delim;   data := dataLine;   tokens := SplitString(data, delimiter);   //tokens := data.Split(delimiter.ToCharArray());   index := -1;   end;      function TSkyStringTokenizer.next: string;   var   s: string;   begin   inc(index);   s := tokens[index];   while ((length(s) <= 0) and (index < tokens.Count)) do   begin   inc(index);   s := tokens[index];   end;   result := s;
察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品