标签: scala string-interpolation
或者,换句话说,是否有一种简单/内置的方式,我可以拥有与以下scala伪代码等效的东西......
val example = "Hello ${name}!" val name = "Bob" val result = interpolate(example) // The hand-wavey step. print(result)
...导致打印此字符串?
Hello, Bob!