I've got this array:
val array : MutableList<String> = mutableListOf("laptop on floor", "man is thomas")
How do I check if it contains this string: flo? (It does, in the first element)
Try this code snippet
val array : MutableList<String> = mutableListOf("laptop on floor", "man is thomas")
val doesContain1 = array.indexOfFirst { it.contains("flo") } >= 0
// or
val doesContain2 = array.find { it.contains("flo") } != null
// or
val doesContain3 = array.any { it.contains("flo") }