//下面是C#版本,最初版本不是我写的 using System; namespace CsharpPats { //String Tokenizer class public class StringTokenizer { private string data, delimiter; private string[] tokens; private int index; public StringTokenizer(string dataLine) { init(dataLine, " "); } private void init(String dataLine, string delim) { delimiter = delim; data = dataLine; tokens = data.Split (delimiter.ToCharArray() ); index = 0; } public StringTokenizer(string dataLine, string delim) { init(dataLine, delim); } public bool hasMoreElements() { return (index < (tokens.Length)); } public string nextElement() { string s = tokens[index++]; while((s.Length <=0) && (index s = tokens[index++]; return s; } } } |
正在阅读:用Delphi实现StringTokenizer功能用Delphi实现StringTokenizer功能
2004-02-14 09:34
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键