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

List.RemoveLastN

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

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

List.RemoveRange(list as list, offset as number, optional count as nullable number) as list  

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.RemoveLastN  
  
    (  
  
    {1, 2, 3, 4, 5},  
  
    3  
  
    )  
  
equals {1, 2}  
  
List.RemoveLastN  
  
    (  
  
    {5, 4, 2, 6, 4},  
  
    each _ > 3  
  
    )  
  
equals {5, 4, 2}  
© 2018 Microsoft