Java: Removing a range of elements from a list

Use List.subList and List.clear as follows:

list.subList(from, to).clear();

See also Removing elements from multiple indexes in a list

Comments

Be the first to comment!