Back to Lo

Core Findlastindexof

docs/data/core-findlastindexof.md

1.53.0259 B
Original Source

Searches for the last element matching the predicate and returns the element, its index, and a boolean indicating success.

go
val, idx, ok := lo.FindLastIndexOf([]string{"a", "b", "a", "b"}, func(i string) bool {
    return i == "b"
})
// "b", 3, true