字符串操作就可以 ---------------------------- function GetToken(var InTxt : String; SpaceChar : CharSet) : String; var i : Integer; begin { Find first SpaceCharacter } i:=1; While (i<=length(InTxt)) and not (InTxt[i] in SpaceChar) do inc(i); { Get text upto that spacechar } Result := Copy(InTxt,1,i-1); { Remove fetched part from InTxt } Delete(InTxt,1,i); { Delete SpaceChars in front of InTxt } i:=1; While (i<=length(InTxt)) and (InTxt[i] in SpaceChar) do inc(i); Delete(InTxt,1,i-1); end; --------------------------------- 上面的代码是可以按照某个分割符号分割字符串,同样的原理可以达到你的要求,具体怎么写我就不写了,我比较懒。
----------------------------------------------
维护世界和平,共创美好盒子。