Logo

Programming-Idioms

  • D
  • Ada
  • Rust
  • Java
  • Perl

Idiom #291 Remove sublist

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

splice @items, $i, ($j - $i);
items.drain(i..j)
items.removeAll(items.subList(i, j));
items.removeRange(i, j);

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