Delete all instance of variable substring between tags in Delphi

后端 未结 1 1606
温柔的废话
温柔的废话 2021-01-21 20:26

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

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-21 20:44

    Try something like this:

    function RemoveIEScripts(const s: string): string; 
    var 
      I, J: Integer; 
    begin 
      Result := s; 
      I := 1;
      repeat
        I := PosEx('', Result, I+4); // 4 = Length('')
      until False;
    end; 
    

    0 讨论(0)
提交回复
热议问题