更新时间:2023-10-31 19:05:22
我想这是因为源文件编码.
尝试检查a.toList.length
和b.toList.length
.似乎是b == "hello\r\nworld"
.
多行字符串文字值不取决于平台,而是取决于源文件的编码.实际上,您将获得"""
之间的源文件中的所有内容.如果有\r\n
,您会在String
中找到它.
Multi-line string literal value depends not on the platform, but on the encoding of the source file. Actually you'll get exactly what you have in the source file between """
. If there is \r\n
you'll get it in your String
.