TakeWhile¶
func TakeWhile[T any](slice []T, predicate func(T) bool) []T
TakeWhile returns elements from the beginning of the slice while the predicate returns true. Stops at the first element where the predicate returns false.
func TakeWhile[T any](slice []T, predicate func(T) bool) []T
TakeWhile returns elements from the beginning of the slice while the predicate returns true. Stops at the first element where the predicate returns false.