Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Character Data

livebook-sessions/character-data.livemd

Character Data

import IEx.Helpers 

Integers and Characters

# i 97
i ?a
{?c, ?a, ?t}

Lists and Charlists

i [99, 97, 116]
[99, 97, 116]
[99, 97, 116] == ~c"cat"
[:a, :sequence, :of, :links]
"cat" == ~c"cat"
# "cat" == 'cat'

Binaries and Strings

i <<0, 1, 2, 3, 4>>
exports(:binary)
byte_size(<<0, 1, 2, 3, 4>>) # 5
bit_size(<<0, 1, 2, 3, 4>>) # 5 * 8 bits = 40 bits
i <?a,?t>
<<99, 97, 116>> # "cat"
<<99, 97, 116>> == "cat"