type Tbackrep=function(Pos:integer):boolean of object; procedure Replace(var Str:string;const substr,dest:string; back:TbackRep=nil);