public readonly property codeUnits as CodeUnit[]:
Returns a snapshot of this string encoded as UTF-16 code units.
CodeUnit is a 16-bit UTF-16 code unit. Consequently, one supplementary Unicode scalar is represented by two adjacent values in this array.
A newly allocated UTF-16 snapshot.
units = "A😀B".codeUnits assert units.size == 4 assert units[1] == `\uD83D` assert units[2] == `\uDE00`