https://kotlinlang.org logo
#announcements
Title
# announcements
j

Jake

12/19/2018, 5:03 PM
Say I have an object that contains constants and I want to check if a value is in that object's values, is there a short way to do this? EX:
Copy code
object Links {
    val HELP = "https://..."
    val SHOP = "https://..."
    val BLOG = "https://..."
    val GALLERY = "https://..."
}
What I'm looking for is the ability to do something like
if (it in Links) doStuff()
where
it == "https://..."