Elixir's equivalent to Ruby's string interpolation - "word is #{var}"

How to do a #{} in Elixir? Thank you!

It’s the same!

8 Likes

fun tip: if you put a variable through a #{} and you get an error about not being able to turn it into a string just add an “inspect” in there: #{inspect my_data}

3 Likes

What inspect does is show the Elixir’y structure of whatever is passed in as a string.

4 Likes