Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #226 Delete last element from list

Remove the last element from list items.

(drop-last items)
items.pop_back();
items.RemoveAt(items.Count - 1);
items = items(1:size(items)-1)
items = items[:len(items)-1]
pop :: [a] -> [a]
pop [] = []
pop xs = init xs

let items2 = pop items
items.pop();
import java.util.List;
items.remove(items.size() - 1);
array_pop($items);
Classes
items.delete(items.count-1);
pop(@items);
items.pop()
items.pop
items.pop();

New implementation...
programming-idioms.org