Skip to content

Instantly share code, notes, and snippets.

Last active Jul 26, 2018
What would you like to do?
Episode 4 source (lesson 2)
filename = IO.gets("File to count the words from: ") |> String.trim()
words =!(filename)
|> String.split(~r{(\\n|[^\w'])+})
|> Enum.filter(fn x -> x != "" end)
words |> Enum.count() |> IO.puts()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment