函数代码
function ContainsDelims(const S, Delimiters: string): Boolean;
var
DelimIdx: Integer; // loops thru delimiters
begin
Result := False;
for DelimIdx := 1 to Length(Delimiters) do
if AnsiPos(Delimiters[DelimIdx], S) > 0 then
begin
Result := True;
Break;
end;
end;
测试
if ContainsDelims('tom354|tosyl32', '|,-') then //| , - 3个分隔符找到任何一个返回True
MessageBox(0,0,0,0);