[英]scala string interpolation for “$”
Why does string interpolation not work when the name of value of '$'?为什么'$'的值名称时字符串插值不起作用?
In the following code, why does the value of $ not get printed?在下面的代码中,为什么没有打印 $ 的值? What is the mistake when the value of x is printed using string interpolation?使用字符串插值打印 x 的值时会出现什么错误?
repl> val x="test value"
repl> val $="some value"
repl> println($)
some value
repl> println(s"value:$x")
value:test value
repl> println(s"value:$$")
value:$
Why is the $ not replaced by its value?为什么 $ 没有被它的价值取代?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.