mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
doc: update doc for Break function
This commit is contained in:
1 parent
5e8a065eaa
commit
73c97af7d8
2 files changed
+5
-5
No files matched your search
@@ -2600,7 +2600,7 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
<span id="Break">Break</span>
|
||||
### <span id="Break">Break</span>
|
||||
|
||||
<p>Splits a slice into two based on a predicate function. It starts appending to the second slice after the first element that matches the predicate. All elements after the first match are included in the second slice, regardless of whether they match the predicate or not.</p>
|
||||
|
||||
@@ -2622,7 +2622,7 @@ func main() {
|
||||
nums := []int{1, 2, 3, 4, 5}
|
||||
even := func(n int) bool { return n%2 == 0 }
|
||||
|
||||
resultEven, resultAfterFirstEven := Break(nums, even)
|
||||
resultEven, resultAfterFirstEven := slice.Break(nums, even)
|
||||
|
||||
fmt.Println(resultEven)
|
||||
fmt.Println(resultAfterFirstEven)
|
||||
|
||||
Reference in new issue
Block a user