char
isAlphabetic
isAlphabetic(ch)
Detect a character whether it is one of a-z or A-Z.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isAlphabetic('a');
// => true
isAlphabetic('1');
// => false
isAlphanumeric
isAlphanumeric(ch)
Detect a character whether it is one of a-z or A-Z or 0-9.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isAlphanumeric('a');
// => true
isAlphanumeric('1');
// => true
isAlphanumeric('*');
// => false
isASCII
isASCII(ch)
Detect a character whether it is an ASCII character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isASCII('a');
// => true
isASCII('1');
// => true
isASCII('你');
// => false
isCJK
isCJK(ch)
Detect a character whether it is a CJK (Chinese, Japanese and Korean) character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isCJK('你');
// => true
isCJK('の');
// => true
isControl
isControl(ch)
Detect a character whether it is a control character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isControl('\t');
// => true
isControl('\r');
// => true
isDigit
isDigit(ch)
Detect a character whether it is a decimal digit (0-9).
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isDigit('0');
// => true
isDigit('1');
// => true
isGraph
isGraph(ch)
Detect a character whether it is a graphic character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isGraph('0');
// => true
isGraph('a');
// => true
isHexadecimal
isHexadecimal(ch)
Detect a character whether it is a hexadecimal character (0-9, a-f, A-F).
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isHexadecimal('0');
// => true
isHexadecimal('a');
// => true
isHexadecimal('A');
// => true
isLower
isLower(ch)
Detect a character whether it is a lower-case character (a-z).
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isLower('a');
// => true
isPrint
isPrint(ch)
Detect a character whether it is a printable character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isPrint('a');
// => true
isPunctuation
isPunctuation(ch)
Detect a character whether it is a punctuation character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isPunctuation(',');
// => true
isSpace
isSpace(ch)
Detect a character whether it is a space character.
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isSpace(' ');
// => true
isUpper
isUpper(ch)
Detect a character whether it is a upper-case character (A-Z).
Since
0.1.0
Arguments
ch (string)
: A string with length equal to 1.
Return
(boolean)
Example
isUpper('a');
// => true