mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
665 B
665 B
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TrimFirst | trimfirst | it/seq.go#L778 | it | string |
|
https://go.dev/play/p/4D4Ke5C5MwH |
|
263 |
TrimFirst removes all the leading cutset from the collection.
collection := func(yield func(int) bool) {
yield(0)
yield(0)
yield(1)
yield(2)
yield(3)
}
trimmed := it.TrimFirst(collection, 0)
var result []int
for item := range trimmed {
result = append(result, item)
}
// result contains [1, 2, 3]