mirror of
https://github.com/samber/lo.git
synced 2025-09-26 20:11:13 +08:00
Added DropByIndex helper for slice (#398)
* added DropByIndex helper --------- Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
This commit is contained in:
@@ -296,6 +296,15 @@ func ExampleDropRightWhile() {
|
||||
// Output: [0 1 2]
|
||||
}
|
||||
|
||||
func ExampleDropByIndex() {
|
||||
list := []int{0, 1, 2, 3, 4, 5}
|
||||
|
||||
result := DropByIndex(list, 2)
|
||||
|
||||
fmt.Printf("%v", result)
|
||||
// Output: [0 1 3 4 5]
|
||||
}
|
||||
|
||||
func ExampleReject() {
|
||||
list := []int{0, 1, 2, 3, 4, 5}
|
||||
|
||||
|
Reference in New Issue
Block a user