Réponse acceptée !
en voici une
Utilisation :
if like('Azerty','A*ty') then showmessage('Azerty like A*ty') else Showmessage('Azerty Not Like A*ty');
Function like(A,b:string):Boolean; var sarg,earg :string; p :Boolean; begin result:=false; if pos('*',b)>1 then begin sarg:=copy(b,1,pos('*',b)-1); P:=True; delete(a,1,(pos(sarg,a)-1)+length(sarg)); end else P:=False; earg:=copy(b,pos('*',b)+1,length(b)); if ((not p) and ((pos(earg,a)+length(earg))=length(a))) or (p and (pos(earg,a)>0)) then result:=true; end;
|