Debug console
Hello Elixir!
[nofile:10: (file)]
sentence #=> "Hello Elixir!\n"
|> String.downcase() #=> "hello elixir!\n"
|> String.replace(~r/\W+/, "") #=> "helloelixir"
|> String.graphemes() #=> ["h", "e", "l", "l", "o", "e", "l", "i", "x", "i", "r"]
|> Enum.frequencies() #=> %{"e" => 2, "h" => 1, "i" => 2, "l" => 3, "o" => 1, "r" => 1, "x" => 1}
Result:
%{"e" => 2, "h" => 1, "i" => 2, "l" => 3, "o" => 1, "r" => 1, "x" => 1}
Note: The code is run in a sandbox powered by Dune.
Its behavior might slightly differ from Elixir and only a restricted subset is supported.