try ```fun String.checkEmpty(str: String?): Strin...
# android
c
try
Copy code
fun String.checkEmpty(str: String?): String? {
    if (!TextUtils.isEmpty(str)) {
        return str
    } else {
        return null
    }
}
s
With this approach I need to perform anyString.checkEmpty("abc") This will not work