Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created November 8, 2020 22:39
Show Gist options
  • Select an option

  • Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f to your computer and use it in GitHub Desktop.

Select an option

Save nicolasblanco/ed71ecb8b6e0875643dafb5445a5d86f to your computer and use it in GitHub Desktop.

Revisions

  1. nicolasblanco created this gist Nov 8, 2020.
    13 changes: 13 additions & 0 deletions test.exs
    Original 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"]