Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created November 8, 2020 22:39
Show Gist options
  • Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f to your computer and use it in GitHub Desktop.
Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f to your computer and use it in GitHub Desktop.
defmodule MyApp do
def split_and_reverse(string) do
string
|> String.split()
|> Enum.reverse()
end
end
"This is a test"
|> MyApp.split_and_reverse()
|> IO.inspect()
# => ["test", "a", "is", "This"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment