Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.024 Beiträge
 
Delphi 12 Athens
 
#4

AW: replace string in text files

  Alt 17. Jan 2020, 21:12
Ignoring the problems mentioned by Dennis07 regarding comments:
Delphi-Quellcode:
function ReplaceBetweenTags(const Source, TagStart, TagEnd, ReplaceWith: string): string;
var
  posEnd: Integer;
  posStart: Integer;
begin
  posStart := Source.IndexOf(TagStart) + TagStart.Length;
  posEnd := Source.IndexOf(TagEnd, posStart);
  Result := Source.Substring(0, posStart) + ReplaceWith + Source.Substring(posEnd);
end;
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat