Table of contents
TOC
Collapse the table of content
Expand the table of content

List.RemoveFirstN

Owen Duncan|Last Updated: 4/19/2018

About

Returns a list with the specified number of elements removed from the list starting at the first element. The number of elements removed depends on the optional countOrCondition parameter.

List.RemoveFirstN( table as table, optional countOrCondition as any) as table  

Arguments

ArgumentDescription
listThe List to remove items from.
optional countOrConditionOptional number of elements or condition to remove elements, default is 1

Remarks

  • If countOrCondidtion is omitted only the first element is removed

  • If countOrCondidtion is a number, that many elements (starting from the top) will be removed)

  • If countOrCondidtion is a condition, the elements that meet the condition will be removed until an element does not meet the condition

Examples

List.RemoveFirstN  

    (  

    {1, 2, 3, 4, 5},  

    3  

    )  

equals {4, 5}  

List.RemoveFirstN  

    (  

    {5, 4, 2, 6, 1},  

    each _ > 3  

    )  

equals { 2, 6, 1}  
© 2018 Microsoft