> For the complete documentation index, see [llms.txt](https://gold.gitbook.io/kotlin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gold.gitbook.io/kotlin/collections/filtering-operations/filternot.md).

# filterNot

```kotlin
public inline fun <T> Iterable<T>.filterNot(predicate: (T) -> Boolean): List<T> {
    return filterNotTo(ArrayList<T>(), predicate)
}

public inline fun <T, C: MutableCollection<in T>>
Iterable<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C {
    for (element in this) if (!predicate(element)) destination.add(element)
    return destination    
} 


val list = listOf(1, 2, 3, 4, 5)
println(list.filterNot{ it > 3 })  // [1, 2, 3]
```
