1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +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

@@ -2603,9 +2603,9 @@ func main() {
}
```
<span id="Break">Break</span>
### <span id="Break">Break</span>
<p>TBD</p>
<p>根据判断函数将切片分成两部分。它开始附加到与函数匹配的第一个元素之后的第二个切片。第一个匹配之后的所有元素都包含在第二个切片中,无论它们是否与函数匹配。</p>
<b>示例:</b>
@@ -2625,7 +2625,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)