Created
November 8, 2020 22:39
-
-
Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f to your computer and use it in GitHub Desktop.
Revisions
-
nicolasblanco created this gist
Nov 8, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ 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"]