1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-10 07:42:27 +08:00

feat:addFindLast for stream (#95)

Co-authored-by: sunyaoyao <sunyaoyao@kezaihui.com>
This commit is contained in:
will
2023-05-18 10:17:15 +08:00
committed by GitHub
parent aa8e0d5c12
commit 1616d3d1be
3 changed files with 43 additions and 0 deletions

View File

@@ -290,6 +290,19 @@ func ExampleStream_FindFirst() {
// true
}
func ExampleStream_FindLast() {
original := FromSlice([]int{3, 2, 1})
result, ok := original.FindLast()
fmt.Println(result)
fmt.Println(ok)
// Output:
// 1
// true
}
func ExampleStream_Reverse() {
original := FromSlice([]int{1, 2, 3})