summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-10-14 10:05:28 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-10-14 11:05:28 +0200
commitb62328cb7676c6f997a92a3b7245daf34c379fb9 (patch)
treebc95d70d819e3de60ebe6f1bf9535ac91cc9eb2a /lib/pure
parent8960efa3407481becf8cdc7151f93a1e789c353a (diff)
downloadNim-b62328cb7676c6f997a92a3b7245daf34c379fb9.tar.gz
Add strip() example (#8002)
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/strutils.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 70f241675..356604f42 100644
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -336,6 +336,8 @@ proc strip*(s: string, leading = true, trailing = true,
   ## If `leading` is true, leading `chars` are stripped.
   ## If `trailing` is true, trailing `chars` are stripped.
   ## If both are false, the string is returned unchanged.
+  runnableExamples:
+    doAssert " vhellov ".strip().strip(trailing = false, chars = {'v'}) == "hellov"
   var
     first = 0
     last = len(s)-1
39' href='#n139'>139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178