Hap*_*ppy 5 comments nested kotlin
如何/*在跨度代码中写入kotlin 注释?
例如:
/**
* Defines the route `/route/*`
*/
fun defineRoute() {
/* ... */
}
Run Code Online (Sandbox Code Playgroud)
现在,根据 Kotlin 的说法,/route/*是嵌套注释的开始(所以整个文件都被注释了)。我现在正在使用/route/{*},但这不是一个不错的解决方案。
您可以使用 HTML 转义,因此在您的示例中:
/**
* Defines the route /route/*
*/
fun defineRoute() {
/* ... */
}
Run Code Online (Sandbox Code Playgroud)
应该达到预期的结果,因为
/作为“/”转义
| 归档时间: |
|
| 查看次数: |
335 次 |
| 最近记录: |