There are ways that you can declare functions on nullable types. Mostly, this is used by Kotlin itself to provide some convenience functions in its standard library.
CharSequence? (the superclass of
String?) has an
function that returns
true if it is called on the empty string (