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