diff options
-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; |