aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions4
1 files changed, 4 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index 50d0eed..6e5dd5d 100644
--- a/global-functions
+++ b/global-functions
@@ -47,6 +47,10 @@
:local ReplaceWith [ :tostr $3 ];
:local Len [ :len $ReplaceFrom ];
+ :if ($ReplaceFrom = "") do={
+ :return $String;
+ }
+
:while ($String ~ $ReplaceFrom) do={
:local Pos [ :find $String $ReplaceFrom ];
:set String ([ :pick $String 0 $Pos ] . $ReplaceWith . [ :pick $String ($Pos + $Len) 999 ]);