Erlang中的字符串分隔符

i-g*_*i-g 6 string erlang

"""在Erlang中是否有与Perl相同的东西?

我希望能够定义一个充满双引号的相当长的字符串而不会逃避每一个.那可能吗?

如果我做错了,请随时告诉我.

谢谢!

Bru*_*man 5

这个怎么样:

1> atom_to_list('He said "hello" and then she answered "hi".').
"He said \"hello\" and then she answered \"hi\"."
Run Code Online (Sandbox Code Playgroud)

您可以定义一个宏来缩写atom_to_list以提高可读性。


rvi*_*ing 5

不。

基本上没有其他办法可以做到这一点。这里提出的建议可行,但看起来比直接的解决方案更复杂,而且不太清晰。