Skip to content

Commit

Permalink
Fixing split symbol with blank separator.
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
h3rald committed Dec 2, 2023
1 parent 51f1ea4 commit b028b43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mnpkg/lang.nim
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ proc lang_module*(i: In) =
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

Expand Down

0 comments on commit b028b43

Please sign in to comment.