dumb question - are there any collection method wh...
# getting-started
v
dumb question - are there any collection method which works as opposite to .slice ? (e.g. returns collection with elements removed at specified range)
e
mutableList.subList(startInclusive, endExclusive).clear()
will remove
.slice(startInclusive until endExclusive)
in-place, if that's what you're looking for
on an immutable list, there's not really anything pre-made...
list.take(startInclusive) + list.drop(endExclusive)
would work though
v
Yep I want it on immutable list
thanks
n
you might also try
filterIndexed
1