Programming-Idioms

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

Idiom #226 Delete last element from list

Remove the last element from list items.

items.pop_back();
items = items[:len(items)-1]
items.pop();
import java.util.List;
items.remove(items.size() - 1);
Classes
items.delete(items.count-1);
items.pop()
items.pop

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org

Related idioms