diff options
author | Erich Eckner <git@eckner.net> | 2016-05-20 10:21:12 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-05-20 10:21:12 +0200 |
commit | effb386323f4259b8436815878a159d16ab9cad8 (patch) | |
tree | a97bef20d4e1ea9a42d50c9f6cf738c2212e18bf | |
parent | f3b592b228a1d0c40fafc1347c8254f35cf56a79 (diff) | |
download | units-effb386323f4259b8436815878a159d16ab9cad8.tar.xz |
replace neu in mystringlistunit.pas
-rw-r--r-- | mystringlistunit.pas | 12 |
1 files changed, 12 insertions, 0 deletions
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; |