Search⌘ K

Binaries and Pattern Matching

Explore how to work with binaries and pattern matching in Elixir. Understand specifying types and qualifiers for binary fields, and learn to process UTF-8 strings using pattern matching techniques similar to list processing but tailored to binaries.

We'll cover the following...

The first rule of binaries is, “If in doubt, specify the type of each field.” Available types are binary, bits, bitstring, bytes, float, integer, utf8, utf16, and utf32. We can also add qualifiers:

  • size(n)
...