mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
Fixing isNilOrWhitespace for empty/nil strings.
`isSpace` returns false for an empty string, which is the opposite of this method.
This commit is contained in:
@@ -331,7 +331,7 @@ proc isNilOrEmpty*(s: string): bool {.noSideEffect, procvar, rtl, extern: "nsuIs
|
||||
## Checks if `s` is nil or empty.
|
||||
result = len(s) == 0
|
||||
|
||||
proc isNilOrWhitespace*(s: string): bool {.noSideEffect, procvar, rtl, extern: "nsuIsNilOrWhitespace".} = isSpace(s)
|
||||
proc isNilOrWhitespace*(s: string): bool {.noSideEffect, procvar, rtl, extern: "nsuIsNilOrWhitespace".} =
|
||||
## Checks if `s` is nil or consists entirely of whitespace characters.
|
||||
##
|
||||
## This is an alias to `isSpace`.
|
||||
|
||||
Reference in New Issue
Block a user