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