Your Turn

  • Exercise: ModulesAndFunctions-7

    Find the library functions to do the following, and then use each in iex. (If the word Elixir or Erlang appears at the end of the challenge, then you’ll find the answer in that set of libraries.)

    • Convert a float to a string with two decimal digits. (Erlang)

    • Get the value of an operating-system environment variable. (Elixir)

    • Return the extension component of a file name (so return .exs if given "dave/test.exs"). (Elixir)

    • Return the process’s current working directory. (Elixir)

    • Convert a string containing JSON into Elixir data structures. (Just find; don’t install.)

    • Execute a command in your operating system’s shell.

Get Programming Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.