kotlin - Is there posibility to disable "string templates"?
问题描述
Kotlin have amazing, which is not present in java, but it is possible to do not use it somehow? Like for example in php:
"$foo"
'$foo'
解决方案
你不能禁用。但是您可以使用\
.
val my_variable = "Some Value"
println("this --> \$my_variable")
上面的代码将打印this --> $my_variable
推荐阅读
- python - 如何使用 backtrader 回测投资组合组合?
- firebase - 从 firebase 获取用户数据并将其存储在静态变量中
- amazon-web-services - 如何以编程方式查询 AWS 服务状态并发布 CURL 命令
- loops - 如何使用 Tokio 在每个周期或间隔以秒为单位触发一个功能?
- mysql - MySql 在 RDS 和本地 docker 容器上的行为不同
- python - HTML - 如何使用 python 抓取不可见的元素?
- windows - 如何制作将通用过滤器应用于屏幕的 Windows 应用程序
- swift - Swift 应用程序在第二次调用时终止
- rtos - Zephyr RTOS 中的 sys_trace_void() 和 sys_trace_end_call() 函数调用有什么作用?
- google-apps-script - Google 表格/文档 - 表格自定义 - 条带