unit TMyTool;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TPMMS=Class(TObject) private public constructor Create(); overload; procedure SeparateTerms(s : string;Separator : char;Terms : TStringList); function matching(id:integer):integer; end;implementation constructor TPMMS.Create(); begin inherited Create; end; //分割字符串过程 procedure TPMMS.SeparateTerms(s : string;Separator : char;Terms : TStringList); var hs : string; p : integer; begin Terms.Clear; // 清除字符串中的内容 if Length(s)=0 then // 长度为0 Exit; p:=Pos(Separator,s); while P<>0 do begin if p<>1 then begin hs:=Copy(s,1,p-1); // 复制字符 Terms.Add(hs); // 添加到列表 Delete(s,1,p); // 删除字符和分割符 p:=Pos(Separator,s); // 查找分割符 end else begin Delete(s,1,p); p:=Pos(Separator,s); end; end; if Length(s)>0 then Terms.Add(s); // 添加剩下的条目end;