Abs
Abs

Reputation: 2344

Equivalent of IO.inspect function that just returns string instead of printing given list, map or keyword list?

Elixir newbie here. I've been trying to convert KeywordList into a string. I can do so with

IO.inspect([name: "John Doe"])

but it prints the string to console. Is there a function that just returns the string?

Upvotes: 33

Views: 7715

Answers (1)

José Valim
José Valim

Reputation: 51429

inspect([name: "John Doe"])

It is defined by the Kernel module and therefore automatically imported.

Upvotes: 50

Related Questions