mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
27 lines
547 B
Markdown
27 lines
547 B
Markdown
---
|
|
name: WithoutNth
|
|
slug: withoutnth
|
|
sourceRef: intersect.go#L223
|
|
category: core
|
|
subCategory: intersect
|
|
playUrl: https://go.dev/play/p/AIro-_UtL9c
|
|
variantHelpers:
|
|
- core#intersect#withoutnth
|
|
similarHelpers:
|
|
- core#intersect#without
|
|
- core#intersect#withoutby
|
|
- core#slice#dropbyindex
|
|
position: 140
|
|
signatures:
|
|
- "func WithoutNth[T comparable, Slice ~[]T](collection Slice, nths ...int) Slice"
|
|
---
|
|
|
|
Returns a slice excluding the elements at the given indexes.
|
|
|
|
```go
|
|
lo.WithoutNth([]int{-2, -1, 0, 1, 2}, 3)
|
|
// []int{-2, -1, 0, 2}
|
|
```
|
|
|
|
|