Elixir 字符串
~s
印记用于生成字符串,作用于双引号相同.当字符串包含双引号和单引号时,~s
印记就很有用了:
iex> ~s(this is a string with "double" quotes, not 'single' ones)
"this is a string with \"double\" quotes, not 'single' ones"
~s
印记用于生成字符串,作用于双引号相同.当字符串包含双引号和单引号时,~s
印记就很有用了:
iex> ~s(this is a string with "double" quotes, not 'single' ones)
"this is a string with \"double\" quotes, not 'single' ones"