Pse*_*328 0 kotlin kotlin-extension
是否可以做类似的事情:
/**
* Converts all of the characters in the string to upper case.
*
* @param str the string to be converted to uppercase
* @return the string converted to uppercase or empty string if the input was null
*/
fun String?.toUpperCase(): String = this?.toUpperCase() ?: ""
Run Code Online (Sandbox Code Playgroud)
toUpperCasenull安全。this?.toUpperCase()表示扩展功能是重命名扩展功能的唯一选择,还是可以从其中引用“超级”功能?