diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2018-10-14 10:05:28 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-14 11:05:28 +0200 |
commit | b62328cb7676c6f997a92a3b7245daf34c379fb9 (patch) | |
tree | bc95d70d819e3de60ebe6f1bf9535ac91cc9eb2a /lib/pure | |
parent | 8960efa3407481becf8cdc7151f93a1e789c353a (diff) | |
download | Nim-b62328cb7676c6f997a92a3b7245daf34c379fb9.tar.gz |
Add strip() example (#8002)
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/strutils.nim | 2 |
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 |