Back to Lo

Core Dropwhile

docs/data/core-dropwhile.md

1.53.0214 B
Original Source

Drops elements from the beginning while the predicate returns true.

go
lo.DropWhile([]string{"a", "aa", "aaa", "aa", "aa"}, func(val string) bool {
    return len(val) <= 2
})
// []string{"aaa", "aa", "aa"}