We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
unicode.splitWhitespace() returns empty strings, but strutils.splitWhitespace() not.
unicode.splitWhitespace()
strutils.splitWhitespace()
Test program:
import std / strutils import std / unicode let s = " foo \t bar baz " echo strutils.splitWhitespace(s) echo unicode.splitWhitespace(s)
Nim Compiler Version 2.0.4 [Linux: amd64] Compiled at 2024-03-28 Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b47747d active boot switches: -d:release
@["foo", "bar", "baz"] @["", "", "foo", "", "", "bar", "", "baz", "", ""]
Two times the same output.
To me it looks like unicode.splitWhitespace() should be adapted to the behaviour of strutils.splitWhitespace(), because the behavior of strutils.splitWhitespace() is documented (https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/strutils.nim#L698).
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
unicode.splitWhitespace()
returns empty strings, butstrutils.splitWhitespace()
not.Test program:
Nim Version
Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-03-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b47747d
active boot switches: -d:release
Current Output
Expected Output
Two times the same output.
Possible Solution
To me it looks like
unicode.splitWhitespace()
should be adapted to the behaviour ofstrutils.splitWhitespace()
, because the behavior ofstrutils.splitWhitespace()
is documented (https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/strutils.nim#L698).Additional Information
No response
The text was updated successfully, but these errors were encountered: