我知道可以将局部变量插入到硬编码字符串中,例如
val amount = "10"
findViewById<TextView>(R.id.textView).text = "There are $amount things."
Run Code Online (Sandbox Code Playgroud)
会输出There are 10 things.. 但是,当我尝试在 strings.xml 文件中执行相同的操作时,例如
<resources>
<string name="some_string">There are $amount things.</string>
</resources>
Run Code Online (Sandbox Code Playgroud)
val amount = "10"
findViewById<TextView>(R.id.textView).text = getString(R.string.some_string)
Run Code Online (Sandbox Code Playgroud)
输出是There are $amount things.. 我怎么解决这个问题?