Char
Definitions
def digit(radix: { radix = Int32 }, c: Char): Option[Int32]
SourceReturns 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]
SourceReturns 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]
SourceReturns the integer value representated by Char c
(e.g. '1' => Some(1)`
)
or None
if c
does not represent a number.
This function cannot handle supplementary characters.
def isAsciiDigit(c: Char): Bool
SourceReturns true
if the given char c
is strictly in the range of ASCII digits 0...9.
def isDefined(c: Char): Bool
SourceReturns 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
SourceReturns 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 isLetterOrDigit(c: Char): Bool
SourceReturns true
if the given char c
is a recognized Unicode letter or digit.
def isSurrogatePair(high: { high = Char }, low: { low = Char }): Bool
SourceReturns true
if the given characters high
and low
represent a valid
Unicode surrogate pair.
def isTitleCase(c: Char): Bool
SourceReturns true
if the given char c
is titlecase, i.e. in the Unicode
category of title case letters.
def toLowerCase(c: Char): Char
SourceConverts a letter to its lowercase version.
Returns the original character if it does not have a lowercase version.
def toSupplementaryCodePoint(high: { high = Char }, low: { low = Char }): Int32
SourceReturns 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
SourceConverts 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
SourceConverts a letter to its uppercase version.
Returns the original character if it does not have a uppercase version.