Category talk:Wren-str: Difference between revisions
→Source code: Multiple bug fixes.
(→Source code: Bug fix.) |
(→Source code: Multiple bug fixes.) |
||
Line 144:
// Checks if a string falls into a particular category.
static allAscii(s) { s != "" && s.codePoints.all { |c| c < 128 } }
static allLatin1(s) { s != "" && s.codePoints.all { |c| c < 256 } }
static allDigits(s) { s != "" && s.codePoints.all { |c| c >= 48 && c <= 57 } }
static allAsciiLower(s) { s != "" && s.codePoints.all { |c| c >= 97 && c <= 122 } }
static allAsciiUpper(s) { s != "" && s.codePoints.all { |c| c >= 65 && c <= 90 } }
static allAsciiLetters(s) { s != "" && s.toList.all { |c| Char.isAsciiLetter(c) } }
static allAsciiAlphaNum(s) { s != "" && s.toList.all { |c| Char.isAsciiAlphaNum(c) } }
static allSpace(s) { s != "" && s.toList.all { |c| Char.isSpace(c) } }
static allLower(s) { s !=
static allUpper(s) { s !=
static allLetters(s) { s !=
static allAlphaNumeric(s) { s !=
static allPrintable(s) { s !=
static allGraphic(s) { s !=
static allWhitespace(s) { s !=
// Checks whether a string can be parsed to a number, an integer or a non-integer (float).
|