Strings are binaries with UTF-8 codepoints in them. You create a string with the usual double-quote syntax:
iex> "hey, a string""hey, a string"
Charlists are, as the name implies, lists of character codes. You create them using the single-quote syntax:
iex> 'hey, a charlist''hey, a charlist'
Since this is just a list, you can use the hd function to get the code for the first character:
iex> hd('hey, a charlist')104
Both representations support string interpolation:
iex> "two plus two is: #{2+2}""two plus two is: 4"iex> 'four minus one is: #{4-1}''four minus one is: 3'
Both ...