Back to Lo

Core Trimleft

docs/data/core-trimleft.md

1.53.0270 B
Original Source

Removes all leading elements found in the cutset from the collection.

go
result := lo.TrimLeft([]int{0, 1, 2, 0, 3, 0}, []int{1, 0})
// []int{2, 0, 3, 0}

result = lo.TrimLeft([]string{"hello", "world", " "}, []string{" ", ""})
// []string{"hello", "world", " "}