mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
577 B
577 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LastIndexOf | lastindexof | find.go#L27 | core | find | https://go.dev/play/p/Eo7W0lvKTky |
|
|
10 |
|
Returns the index of the last occurrence of a value in a slice, or -1 if not found.
idx := lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 2)
// 4
idx = lo.LastIndexOf([]int{0, 1, 2, 1, 2, 3}, 6)
// -1