使用字符串模板

var a = 1
val s1 = "a is $a"
a = 2
val s2 = "${s1.replace("is", "was")}, but now is $a"

results matching ""

    No results matching ""