summary refs log tree commit diff stats
path: root/lib/pure/strutils.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-03-06 21:16:05 +0100
committerAraq <rumpf_a@web.de>2011-03-06 21:16:05 +0100
commit3005955d20033db12345eacd6eb8ff8cec92507c (patch)
treef7a799c00006ceb3dc660b125ab7fb8efcf6b4bf /lib/pure/strutils.nim
parente424e13bd9d05ab3fbcbe3572e49c1bc611a1fc9 (diff)
downloadNim-3005955d20033db12345eacd6eb8ff8cec92507c.tar.gz
distinction between re.replace and re.replacef; speed improvements for re module
Diffstat (limited to 'lib/pure/strutils.nim')
-rwxr-xr-xlib/pure/strutils.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 0673a9588..435f522eb 100755
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -687,7 +687,7 @@ proc contains*(s: string, chars: set[char]): bool {.noSideEffect.} =
   ## Same as ``find(s, chars) >= 0``.

   return find(s, chars) >= 0

 

-proc replace*(s, sub, by: string): string {.noSideEffect,

+proc replace*(s, sub: string, by = ""): string {.noSideEffect,

   rtl, extern: "nsuReplaceStr".} =

   ## Replaces `sub` in `s` by the string `by`.

   var a: TSkipTable

@@ -800,7 +800,7 @@ proc escape*(s: string, prefix = "\"", suffix = "\""): string {.noSideEffect,
   ##   by ``\xHH`` where ``HH`` is its hexadecimal value.

   ## The procedure has been designed so that its output is usable for many

   ## different common syntaxes. The resulting string is prefixed with

-  ## ``prefix`` and suffixed with ``suffix``. Both may be empty strings.

+  ## `prefix` and suffixed with `suffix`. Both may be empty strings.

   result = prefix

   for c in items(s):

     case c