cleaned up strutils.nim
This commit is contained in:
parent
5e93eb9d7a
commit
653dcb8027
1 changed files with 13 additions and 17 deletions
|
|
@ -32,10 +32,6 @@ when defined(nimOldSplit):
|
||||||
else:
|
else:
|
||||||
{.pragma: deprecatedSplit.}
|
{.pragma: deprecatedSplit.}
|
||||||
|
|
||||||
type
|
|
||||||
CharSet* {.deprecated.} = set[char] # for compatibility with Nim
|
|
||||||
{.deprecated: [TCharSet: CharSet].}
|
|
||||||
|
|
||||||
const
|
const
|
||||||
Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'}
|
Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'}
|
||||||
## All the characters that count as whitespace.
|
## All the characters that count as whitespace.
|
||||||
|
|
@ -82,7 +78,7 @@ proc isAlphaNumeric*(c: char): bool {.noSideEffect, procvar,
|
||||||
## Checks whether or not `c` is alphanumeric.
|
## Checks whether or not `c` is alphanumeric.
|
||||||
##
|
##
|
||||||
## This checks a-z, A-Z, 0-9 ASCII characters only.
|
## This checks a-z, A-Z, 0-9 ASCII characters only.
|
||||||
return c in Letters or c in Digits
|
return c in Letters+Digits
|
||||||
|
|
||||||
proc isDigit*(c: char): bool {.noSideEffect, procvar,
|
proc isDigit*(c: char): bool {.noSideEffect, procvar,
|
||||||
rtl, extern: "nsuIsDigitChar".} =
|
rtl, extern: "nsuIsDigitChar".} =
|
||||||
|
|
@ -123,7 +119,7 @@ proc isAlphaAscii*(s: string): bool {.noSideEffect, procvar,
|
||||||
|
|
||||||
result = true
|
result = true
|
||||||
for c in s:
|
for c in s:
|
||||||
result = c.isAlphaAscii() and result
|
if not c.isAlphaAscii(): return false
|
||||||
|
|
||||||
proc isAlphaNumeric*(s: string): bool {.noSideEffect, procvar,
|
proc isAlphaNumeric*(s: string): bool {.noSideEffect, procvar,
|
||||||
rtl, extern: "nsuIsAlphaNumericStr".} =
|
rtl, extern: "nsuIsAlphaNumericStr".} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue