I\'m extracting readable text from HTML into a string and I need to remove the existing text between the tags. What would be the
Try something like this:
function RemoveIEScripts(const s: string): string;
var
I, J: Integer;
begin
Result := s;
I := 1;
repeat
I := PosEx('<!--', Result, I);
if I = 0 then Break;
J := PosEx('-->', Result, I+4); // 4 = Length('<!--')
if J = 0 then Break;
Delete(Result, I, (J+3)-I); // 3 = Length('-->')
until False;
end;