From effb386323f4259b8436815878a159d16ab9cad8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 20 May 2016 10:21:12 +0200 Subject: replace neu in mystringlistunit.pas --- mystringlistunit.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mystringlistunit.pas') diff --git a/mystringlistunit.pas b/mystringlistunit.pas index e01abff..d37be08 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -27,6 +27,7 @@ type function metaReadln(out s: string; subRoutine: boolean): boolean; inline; procedure grep(expr: string; invert: boolean = false); function grepFirst(expr: string): string; + procedure replace(von,nach: string); procedure append(sl: tMyStringList); overload; function hatZeile(zeile: string): boolean; // invers zu "grep -c" function eof: boolean; @@ -216,6 +217,17 @@ begin result:=''; end; +procedure tMyStringlist.replace(von,nach: string); +var + re: tRegExpr; + i: longint; +begin + re:=tRegExpr.create; + re.expression:=von; + for i:=0 to count-1 do + self[i]:=re.replace(self[i],nach,true); +end; + procedure tMyStringlist.append(sl: tMyStringList); var i: longint; -- cgit v1.2.3-70-g09d2