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無法正常工作查看編輯問題中報告的錯誤 –