skipwhile

LUA

skipwhile

<lst>:skipwhile(predicate(item, pos))

Scarta gli elementi della lista finché il predicato è vero.

Esempio 214. Esempio skipwhile

local orders = {  {orderid=1, product="Computer", price=1000, year=2010},
 {orderid=3, product="TV",       price=800,  year=2011},
 {orderid=1, product="Book",     price=50,   year=2012},
}
local res = XTable(orders)
            :skipwhile(function(item) return item.year<2011; end)
            :astable()
--> {{orderid=3, product="TV", price=800,  year=2011},
    {orderid=1, product="Book", price=50,   year=2012}}