What is the correct way of defining a Kotlin string that includes the characters for declaring a template substitution, but not have this evaluated as a template?
For example: "${something}" just treated as an ordinary string.
"${something}"
I would like to use the Spring value annotation:
@Value("${some.property}) lateinit var foobar : String?
This works for me:
val s = "${foo}" println("s = ${s}") // prints s = ${foo}
The documented way also works fine:
val s = "${'$'}{foo}" println("s = ${s}") // prints s = ${foo}
1.4m articles
1.4m replys
5 comments
57.0k users