Version: v0.8.1 - Beta.  We welcome contributors & feedback.

String.toBytes

toBytes() -> list

Description

Get a list of the integer byte values in the string.

Note that some characters will take up more than one byte.

If you need the Unicode values, see charToUnicode instead.

'I ♥ THT'.toBytes()
//= [
//    73,             --> I
//    32,             --> (space)
//    226, 153, 165,  --> ♥
//    32,             --> (space)
//    84, 72, 84      --> THT
// ]

See Also