Package unicode provides data and functions to test some properties of Unicode code points.

Static methods

staticinlinein_(_r:GoInt32, _ranges:Rest<Ref<RangeTable>>):Bool

In reports whether the rune is a member of one of the ranges.

staticinlineisControl(_r:GoInt32):Bool

IsControl reports whether the rune is a control character. The C (Other) Unicode category includes more code points such as surrogates; use Is(C, r) to test for them.

staticinlineisDigit(_r:GoInt32):Bool

IsDigit reports whether the rune is a decimal digit.

staticinlineisGraphic(_r:GoInt32):Bool

IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories L, M, N, P, S, Zs.

staticinlineisLetter(_r:GoInt32):Bool

IsLetter reports whether the rune is a letter (category L).

staticinlineisLower(_r:GoInt32):Bool

IsLower reports whether the rune is a lower case letter.

staticinlineisMark(_r:GoInt32):Bool

IsMark reports whether the rune is a mark character (category M).

staticinlineisNumber(_r:GoInt32):Bool

IsNumber reports whether the rune is a number (category N).

staticinlineisOneOf(_ranges:Slice<Ref<RangeTable>>, _r:GoInt32):Bool

IsOneOf reports whether the rune is a member of one of the ranges. The function "In" provides a nicer signature and should be used in preference to IsOneOf.

staticinlineisPrint(_r:GoInt32):Bool

IsPrint reports whether the rune is defined as printable by Go. Such characters include letters, marks, numbers, punctuation, symbols, and the ASCII space character, from categories L, M, N, P, S and the ASCII space character. This categorization is the same as IsGraphic except that the only spacing character is ASCII space, U+0020.

staticinlineisPunct(_r:GoInt32):Bool

IsPunct reports whether the rune is a Unicode punctuation character (category P).

staticinlineisSpace(_r:GoInt32):Bool

IsSpace reports whether the rune is a space character as defined by Unicode's White Space property; in the Latin-1 space this is

'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).

Other definitions of spacing characters are set by category Z and property Pattern_White_Space.

staticinlineisSymbol(_r:GoInt32):Bool

IsSymbol reports whether the rune is a symbolic character.

staticinlineisTitle(_r:GoInt32):Bool

IsTitle reports whether the rune is a title case letter.

staticinlineisUpper(_r:GoInt32):Bool

IsUpper reports whether the rune is an upper case letter.

staticinlineis_(_rangeTab:Ref<RangeTable>, _r:GoInt32):Bool

Is reports whether the rune is in the specified table of ranges.

staticinlinesimpleFold(_r:GoInt32):GoInt32

SimpleFold iterates over Unicode code points equivalent under the Unicode-defined simple case folding. Among the code points equivalent to rune (including rune itself), SimpleFold returns the smallest rune > r if one exists, or else the smallest rune >= 0. If r is not a valid Unicode code point, SimpleFold(r) returns r.

For example:

SimpleFold('A') = 'a'
SimpleFold('a') = 'A'

SimpleFold('K') = 'k'
SimpleFold('k') = '\u212A' (Kelvin symbol, K)
SimpleFold('\u212A') = 'K'

SimpleFold('1') = '1'

SimpleFold(-2) = -2

staticinlineto(__case:GoInt, _r:GoInt32):GoInt32

To maps the rune to the specified case: UpperCase, LowerCase, or TitleCase.

staticinlinetoLower(_r:GoInt32):GoInt32

ToLower maps the rune to lower case.

staticinlinetoTitle(_r:GoInt32):GoInt32

ToTitle maps the rune to title case.

staticinlinetoUpper(_r:GoInt32):GoInt32

ToUpper maps the rune to upper case.