if not CharacterInTokens(source[index], sl) then begin temp := temp + source[Index]; end else begin result.Add(temp); temp := ''; end; //if end; // for if (temp <> '') then result.Add(temp); sl.Free; end; function TSkyStringTokenizer.CharacterInTokens(ch: string; const sl: TStringList): boolean; var index: integer; // I: Integer; begin result := false; for Index := 0 to sl.Count - 1 do // Iterate begin result := result or (ch = sl[Index]); {if ch = sl[index] then begin result := true; break; end; } end; // for end; destructor TSkyStringTokenizer.destroy; begin tokens.Free ; inherited; end; end. |
正在阅读:用Delphi实现StringTokenizer功能用Delphi实现StringTokenizer功能
2004-02-14 09:34
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键