O'Reilly logo

Programming Elixir by Dave Thomas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required