简体   繁体   English

等效的IO.inspect函数只返回字符串而不是打印给定列表,地图或关键字列表?

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

Elixir newbie here. Elixir新手在这里。 I've been trying to convert KeywordList into a string. 我一直在尝试将KeywordList转换为字符串。 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? 是否有一个只返回字符串的函数?

inspect([name: "John Doe"])

它由内核模块定义,因此会自动导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM