I have a string array and I want to check if it contains some string while ignoring the case, so I do
businessCategories.contains(currentCategory, ignoreCase = true)
but it displays the error:
Cannot find a parameter with this name: ignoreCase
Why doesn't my list recognise the param ignoreCase? I read about the function in a few places: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/contains.html and https://bladecoder.medium.com/the-kotlin-standard-function-will-not-just-improve-readability-in-this-case-but-performance-as-well-5515822ce216, so why is ignoreCase not available?
businessCategoriesisn't aCharSequence, it's an array? The documentation you've linked is for aCharSequence. The function you're calling is this: kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/…businessCategoriesto CharSequence first? Or is there a better way?elements.any { it.equals("Something", ignoreCase = true) }CharSequencewithout defining what that means: concatenating it? Adding commas in between? Etc.elements.any { it.equals("Something", ignoreCase = true) }is what I actually need. Can you post it as the answer so that I can accept it, and maybe add a little more explanation to it that may help new Kotlin learners understand more?