Skip to content

Instantly share code, notes, and snippets.

@Harrisonl
Created November 24, 2016 08:23
Show Gist options
  • Save Harrisonl/c3526c7325ab07a553601048ec64bf48 to your computer and use it in GitHub Desktop.
Save Harrisonl/c3526c7325ab07a553601048ec64bf48 to your computer and use it in GitHub Desktop.
defmodule Binary do
def strip_vowels("", acc), do: acc
def strip_vowels(<<head::binary-size(1), rest::binary>>, acc \\ "") do
strip_vowels(rest, acc <> check_vowels(head))
end
defp check_vowels("a"), do: ""
defp check_vowels("e"), do: ""
defp check_vowels("i"), do: ""
defp check_vowels("o"), do: ""
defp check_vowels("u"), do: ""
defp check_vowels(letter), do: letter
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment