Fixing split symbol with blank separator. Fixes #4
h3rald h3rald@h3rald.com
Sat, 02 Dec 2023 14:29:25 +0000
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
mnpkg/lang.nim
→
mnpkg/lang.nim
@@ -267,7 +267,12 @@ let vals = i.expect("'sym", "'sym")
let sep = vals[0].getString let s = vals[1].getString var q = newSeq[MnValue](0) - for e in s.split(sep): + var ss: seq[string] + if sep == "": + ss = s.items.toSeq.mapIt($it) + else: + ss = s.split(sep) + for e in ss: q.add e.newVal i.push q.newVal