nim-stew/stew/strings.nim

7 lines
186 B
Nim
Raw Normal View History

2021-12-02 15:24:02 +00:00
proc add*(s: var string, data: openArray[char]) =
if data.len > 0:
let prevEnd = s.len
s.setLen(prevEnd + data.len)
copyMem(addr s[prevEnd], unsafeAddr data[0], data.len)