Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Java

Idiom #291 Remove sublist

Delete all the elements from index i (included) to index j (excluded) from the list items.

items.removeAll(items.subList(i, j));
items.removeRange(i, j);

New implementation...
< >
programming-idioms.org