mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
619 B
619 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | similarHelpers | position | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| TrimLast | trimlast | it/seq.go#L778 | it | string |
|
|
264 |
TrimLast removes all the trailing cutset from the collection.
collection := func(yield func(int) bool) {
yield(1)
yield(2)
yield(3)
yield(0)
yield(0)
}
trimmed := it.TrimLast(collection, 0)
var result []int
for item := range trimmed {
result = append(result, item)
}
// result contains [1, 2, 3]