From b62328cb7676c6f997a92a3b7245daf34c379fb9 Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Sun, 14 Oct 2018 10:05:28 +0100 Subject: [PATCH] Add strip() example (#8002) --- lib/pure/strutils.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 70f241675f..356604f42c 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