I have recently decided to switch from Java to Kotlin for Android Development. I don’t know what to Google, so I’m asking here.
If we want to get the opposite of a boolean, we put a ! before it. Eg: I want the inside code to run only if the contains() returns false. How to do that?
Example, we do this in Java:
if (!string_text.contains(" "))
How do I write this in Kotlin?
! is the boolean not operator, same as Java.
Answered By – al3c