klyn.Char.Char
constructor
public native Char(value as CodeUnit)
Description

Converts one UTF-16 code unit to a Char.

Klyn applies this conversion implicitly where a Char is expected. A surrogate code unit is rejected with ValueException, because it does not represent a complete Unicode scalar on its own.

Parameters
ParameterDescription
valueUTF-16 code unit to convert.
Throws
  • ValueException if value is an isolated surrogate.
Example
assert Char(`K`) == 'K'