1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 15:12:26 +08:00

doc: update doc for Break function

This commit is contained in:
dudaodong
2024-03-08 21:39:06 +08:00
parent 5e8a065eaa
commit 73c97af7d8
2 changed files with 5 additions and 5 deletions

View File

@@ -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)