Chetan Tuteja
12/27/2021, 7:30 AMin
check for that.
Is there any way to do the same check while ignoring case check? I am trying to fetch string array from XML. I know I can do any
check, but is there a better more elegant way?
val abc = "abc"
val random = arrayOf("ABC", "egf")
val isThere = abc in random // Prints false
app.resources.getStringArray(R.array.models).any { model -> model.equals(PrefUtils.getBuildModel(), ignoreCase = true) }
Max Ferrier
12/27/2021, 10:16 AMval isThere = random.any { it.equals(abc, true) }
is the best solution for me. It avoids you to transform everything with lowerCase()