Logo

Programming-Idioms

  • Cobol
  • Lua

Idiom #291 Remove sublist

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

local function erase(t,i,j)
 for i=1,j-1 do
  t[i]=nil
 end
end
erase(items,i,j)
items.removeRange(i, j);

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