XU XUv0.8.8
中文

API

#unicode

import: #unicode

counts: 17 fns, 0 methods, 0 types, 0 consts, 0 ifaces

Code-point classes and case (including extra whitespace).

is_digit

XuAPI
pub fn is_digit(r int) bool

Purpose

is_digit reports whether r is in Unicode category Nd ( unicode.IsDigit).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_letter

XuAPI
pub fn is_letter(r int) bool

Purpose

is_letter reports whether r is in Lu|Ll|Lt|Lm|Lo ( unicode.IsLetter).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_space

XuAPI
pub fn is_space(r int) bool

Purpose

is_space reports Unicode whitespace: Zs, ASCII whitespace and U+0085/U+2028/U+2029 (the same set as unicode.IsSpace).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_control

XuAPI
pub fn is_control(r int) bool

Purpose

Whether it is control.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_print

XuAPI
pub fn is_print(r int) bool

Purpose

Whether it is print.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_graphic

XuAPI
pub fn is_graphic(r int) bool

Purpose

Whether it is graphic.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_punct

XuAPI
pub fn is_punct(r int) bool

Purpose

Whether it is punct.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_number

XuAPI
pub fn is_number(r int) bool

Purpose

Whether it is number.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_title

XuAPI
pub fn is_title(r int) bool

Purpose

Whether it is title.

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

to_title

XuAPI
pub fn to_title(r int) int

Purpose

Convert to title.

Parameters

r int
rune (Unicode code point) (int)

Returns

int — a value of this type

max_rune_value

XuAPI
pub fn max_rune_value() int

Purpose

Max rune value.

Parameters

none

Returns

int — a value of this type

is_upper

XuAPI
pub fn is_upper(r int) bool

Purpose

is_upper reports whether r is in Unicode category Lu ( unicode.IsUpper).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

is_lower

XuAPI
pub fn is_lower(r int) bool

Purpose

is_lower reports whether r is in Unicode category Ll ( unicode.IsLower).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false

to_upper

XuAPI
pub fn to_upper(r int) int

Purpose

to_upper returns the simple upper-case mapping of r ( unicode.ToUpper) non-letter runes (and runes with no single-rune upper) are returned as-is.

Parameters

r int
rune (Unicode code point) (int)

Returns

int — a value of this type

to_lower

XuAPI
pub fn to_lower(r int) int

Purpose

to_lower returns the simple lower-case mapping of r ( unicode.ToLower). U+0130 maps to U+0069 ('i'), using the Unicode simple single-rune mapping. ASCII letters only.

Parameters

r int
rune (Unicode code point) (int)

Returns

int — a value of this type

simple_fold

XuAPI
pub fn simple_fold(r int) int

Purpose

Simple fold.

Parameters

r int
rune (Unicode code point) (int)

Returns

int — a value of this type

is_symbol

XuAPI
pub fn is_symbol(r int) bool

Purpose

is_symbol includes all Unicode S categories (Sm|Sc|Sk|So).

Parameters

r int
rune (Unicode code point) (int)

Returns

bool — true or false