Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is opposite to 'in' condition in Kotlin – '!` mark equivalent to Java

In Java we do use ! in case we want to say NOT. But what should I use in Kotlin if I follow some range condition.

if( item in 5..10)

So here I want to say if item NOT in 5..10 ?? what is the proper construction?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use !in operator:

if (item !in 5..10)

See documentation for a full list of operators:

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading