mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
956 B
956 B
name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | playUrl | variantHelpers | similarHelpers | position | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| HasSuffix | hassuffix | it/find.go#L71 | it | find |
|
https://go.dev/play/p/4RcKL5ie-p |
|
|
30 |
Returns true if the collection has the specified suffix. The suffix can be specified as multiple arguments.
Examples:
seq := func(yield func(int) bool) {
_ = yield(1)
_ = yield(2)
_ = yield(3)
_ = yield(4)
}
hasSuffix := it.HasSuffix(seq, 3, 4)
// hasSuffix == true
seq := func(yield func(string) bool) {
_ = yield("hello")
_ = yield("world")
}
hasSuffix := it.HasSuffix(seq, "world")
// hasSuffix == true
seq := func(yield func(int) bool) {
_ = yield(1)
_ = yield(2)
_ = yield(3)
}
hasSuffix := it.HasSuffix(seq, 1, 2)
// hasSuffix == false