Created
November 24, 2016 08:23
-
-
Save Harrisonl/c3526c7325ab07a553601048ec64bf48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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