Char
Definitions
def
digit
(
radix :
{ radix = Int32 }
c :
Char
)
: Option[Int32]
\ Pure
Returns the integer value representated by Char c
with respect to radix
. E.g.
digit(radix = 10, '1') => Some(1)
digit(radix = 16, 'a') => Some(11)
Returns None
if c
does not represent a number.
def
forDigit
(
radix :
{ radix = Int32 }
n :
Int32
)
: Option[Char]
\ Pure
Returns a character representation of the integer n
with respect to radix
. E.g.
forDigit(radix = 10, 1) => Some('1')
forDigit(radix = 16, 11) => Some('a')
Returns None
if n
is not representable as single character in the radix.
def
getNumericValue
(
c :
Char
)
: Option[Int32]
\ Pure
Returns the integer value representated by Char c
(e.g. '1' => Some(1)``) or
Noneif
c` does not represent a number.
This function cannot handle supplementary characters.
def
isAscii
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is an ascii character.
def
isAsciiDigit
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is strictly in the range of ASCII digits 0...9.
def
isDefined
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is defined either as a entry in the
UnicodeData file or a value within a range defined in the UnicodeData file.
def
isDigit
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is a recognized Unicode digit.
This includes the ASCII range 0..9 but also Arabic-Indic digits, Devagari digits and Fullwidth digits.
def
isHexDigit
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is in the range 0...F.
def
isISOControl
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is an ISO control character.
def
isLetter
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is a letter character.
def
isLetterOrDigit
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is a recognized Unicode letter or digit.
def
isLowerCase
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is lowercase.
def
isMirrored
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is mirrored.
def
isOctDigit
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is in the range 0...7.
def
isSurrogate
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is a surrogate code unit.
def
isSurrogatePair
(
high :
{ high = Char }
low :
{ low = Char }
)
: Bool
\ Pure
Returns true
if the given characters high
and low
represent a valid
Unicode surrogate pair.
def
isTitleCase
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is titlecase, i.e. in the Unicode
category of title case letters.
def
isUpperCase
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is uppercase.
def
isWhiteSpace
(
c :
Char
)
: Bool
\ Pure
Returns true
if the given char c
is a white space character.
def
maxValue
: Char
\ Pure
Returns the character given by the maximum valued byte.
def
minValue
: Char
\ Pure
Returns the character given by the all zero byte.
def
toBmpCodePoint
(
c :
Char
)
: Int32
\ Pure
Returns the code point representation of Char c
.
def
toLowerCase
(
c :
Char
)
: Char
\ Pure
Converts a letter to its lowercase version.
Returns the original character if it does not have a lowercase version.
def
toString
(
c :
Char
)
: String
\ Pure
Returns the character c
as a string.
def
toSupplementaryCodePoint
(
high :
{ high = Char }
low :
{ low = Char }
)
: Int32
\ Pure
Returns the supplementary code point value of the surrogate pair high
and low
.
Caution - this function does no validation, use isSurrogatePair
to check high
and low
are valid.
def
toTitleCase
(
c :
Char
)
: Char
\ Pure
Converts a letter to its titlecase version.
Returns the original character if it does not have either a titlecase version or a mapping to uppercase.
def
toUpperCase
(
c :
Char
)
: Char
\ Pure
Converts a letter to its uppercase version.
Returns the original character if it does not have a uppercase version.