Back to Lo

Core Zipbyx

docs/data/core-zipbyx.md

1.53.0290 B
Original Source

Zips multiple slices and projects each grouped set through a function. Variants support 2 up to 9 input slices.

Variants: ZipBy2..ZipBy9

go
xs := []int{1,2}
ys := []string{"a","b"}
pairs := lo.ZipBy2(xs, ys, func(x int, y string) string {
    return fmt.Sprintf("%d-%s", x, y)
})