Created
November 8, 2020 22:39
-
-
Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f 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 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