TryCreate()

Rune::TryCreate(char16_t, Rune&) method

Attempts to create a Rune from the provided UTF-16 code unit.

static bool System::Text::Rune::TryCreate(char16_t ch, Rune &result)

Arguments

ParameterTypeDescription
chchar16_tThe code unit to convert.
resultRune&The resulting Rune if the input is not a surrogate.

Return Value

true if the code unit represents a valid scalar value; otherwise, false.

Rune::TryCreate(char16_t, char16_t, Rune&) method

Attempts to create a Rune from the provided UTF-16 surrogate pair.

static bool System::Text::Rune::TryCreate(char16_t highSurrogate, char16_t lowSurrogate, Rune &result)

Arguments

ParameterTypeDescription
highSurrogatechar16_tThe high surrogate code unit.
lowSurrogatechar16_tThe low surrogate code unit.
resultRune&The resulting Rune if the input represents a valid surrogate pair.

Return Value

true if the input represents a well-formed UTF-16 surrogate pair; otherwise, false.

See Also