mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
* fixes #17173 * add testcase (#17214) * Apply suggestions from code review * fix for newruntime * Apply suggestions from code review * Update lib/system.nim * Update lib/system.nim * Update lib/system.nim Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>
This commit is contained in:
@@ -80,11 +80,13 @@ func setSlice*(s: var string, slice: Slice[int]) =
|
||||
when not declared(moveMem):
|
||||
impl()
|
||||
else:
|
||||
when defined(nimSeqsV2):
|
||||
prepareStrMutation(s)
|
||||
moveMem(addr s[0], addr s[first], last - first + 1)
|
||||
s.setLen(last - first + 1)
|
||||
|
||||
func strip*(a: var string, leading = true, trailing = true, chars: set[char] = whitespaces) {.inline.} =
|
||||
## Inplace version of `strip`. Strips leading or
|
||||
## Inplace version of `strip`. Strips leading or
|
||||
## trailing `chars` (default: whitespace characters).
|
||||
##
|
||||
## If `leading` is true (default), leading `chars` are stripped.
|
||||
|
||||
Reference in New Issue
Block a user