[英]convert function from java to kotlin
i tried pasing a java function in my Kotlin project and in automatically converted to Kotlin but still has an error.我尝试在我的 Kotlin 项目中粘贴一个 java function 并自动转换为 Z539A12A5859D6FBB4 错误,但仍然有错误。
if (ch.toInt() >= 0x0660 && ch.toInt() <= 0x0669)
ch -= 0x0660 - '0'
else if (ch.toInt() >= 0x06f0 && ch.toInt() <= 0x06F9)
ch -= 0x06f0 - '0'
it is giving error on the - "0"
the error is: Non of the following functions can be called with the argument supplied它在
- "0"
上给出错误错误是:不能使用提供的参数调用以下函数
This is because kotlin doesn't type cast between char and int.这是因为 kotlin 不在 char 和 int 之间进行类型转换。 You'll have to invoke
.toInt()
on the '0'
like you already did with the char.您必须像对 char 所做的那样在
'0'
上调用.toInt()
。 The Int
class only supports minus
with the following types: Int
class 仅支持以下类型的minus
:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.