List.Chars and String.Chars
Explore how to use the List.Chars and String.Chars protocols in Elixir to convert values to character lists and strings. Understand how these protocols support polymorphic functions and how they enable flexible string interpolation in your code.
We'll cover the following...
We'll cover the following...
Introduction
The List.Chars protocol is used by Kernel.to_charlist to convert a value into a list of characters (think single-quoted string).
The String.Chars protocol is used to convert a ...