``` fun foo(foo1: String) : Boolean { var ...
# announcements
o
Copy code
fun foo(foo1: String) : Boolean {
        var hasit = false
        for(fooS in fooList) {
            if(fooS == foo1) {
                hasit = true
                break
            }
            else continue
        }
        return hasit
    }
...
var fooList = listOf<String>(...)
How do i change the above function to use collection functions like forEach or anything else ?
r
Actually, you can just use
foo1 in fooList