10
我已经嵌入“刺:你如何在Elixir字符串中嵌入双引号?
tx <iq id="wUcdTMYuYoo41" to="[email protected]" type="set" xmlns="w:profile:picture">
我怎么能出现这样的字符串作为药剂的值
例如:
iex> s= "tx <iq id="wUcdTMYuYoo41" to="[email protected]" type="set" xmlns="w:profile:picture">"
使用382 4和〜S没有帮助
iex(20)> s=~S("tx <iq id="wUcdTMYuYoo41" to="[email protected]" type="set" xmlns="w:profile:picture">")
** (SyntaxError) iex:20: keyword argument must be followed by space after: w:
iex(20)> s=~s("tx <iq id="wUcdTMYuYoo41" to="[email protected]" type="set" xmlns="w:profile:picture">")
** (SyntaxError) iex:20: keyword argument must be followed by space after: w:
iex(20)>
谢谢。当我们从File.stream!(“path/to/file”)拉出这样的字符串时,我们是否需要做同样的事情?在每一行返回? –
使用'File.Stream'会自动转义引号。例如'iex(4)> IO.gets“>”; >“”“”TEST“”“;”\“\”\“\”TEST \“\”\“\ n”' – Gazler
请〜s和〜S无法正常工作查看编辑问题中报告的错误 –