Last active
November 24, 2016 09:44
-
-
Save Harrisonl/a5be825f78d2e6598cafa5c806efeec2 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(a,b \\ "") | |
def strip_vowels("", acc), do: acc | |
def strip_vowels(<<"a", rest::binary>>, acc), do: strip_vowels(rest, acc) | |
def strip_vowels(<<"e", rest::binary>>, acc), do: strip_vowels(rest, acc) | |
def strip_vowels(<<"i", rest::binary>>, acc), do: strip_vowels(rest, acc) | |
def strip_vowels(<<"o", rest::binary>>, acc), do: strip_vowels(rest, acc) | |
def strip_vowels(<<"u", rest::binary>>, acc), do: strip_vowels(rest, acc) | |
def strip_vowels(<<head::binary-size(1), rest::binary>>, acc), do: strip_vowels(rest, acc <> head) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment