str:=s; for i:=1 to 10 do begin n:=Pos(s1,fragm); str:=Copy(str,Pos(str,fragm)+length(fragm),length(str)); end;