-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
split example from std/unicode doesn't run #17174
Comments
This is how I got the example working: import std/unicode
let splitters = ";:$"
for word in split("this:is;an$example", splitters.toRunes):
writeLine(stdout, word) But it's cumbersome, what is the easiest way to make a set/seq/openarrray of |
looks almost identical to the example. if you inline the variable its even the same line count. |
Okay cumbersome might be the wrong word :P, it's just a bad example, like is anyone ever gonna use a string made of characters to split a word? import std/unicode
for word in split("this:is;an$example", ";:$".toRunes):
writeLine(stdout, word) |
The example at https://nim-lang.org/docs/unicode.html#split.i%2Cstring%2CRune%2Cint does not run.
https://play.nim-lang.org/#ix=2QI0
Example
Current Output
Expected Output
Possible Solution
I have no idea, sorry, I'm a noob
Additional Information
I switched to using strutils and that works fine with the above example.
The text was updated successfully, but these errors were encountered: