Function Repository Resource:

TrimRight

Source Notebook

Shorten lists to the same length by removing elements from the right

Contributed by: Taliesin Beynon

ResourceFunction["TrimRight"][{list1,list2,}]

trims all listi to the length of the shortest list, removing elements from the right.

Examples

Basic Examples (1) 

Trim the lists by removing elements from the right:

In[1]:=
ResourceFunction["TrimRight"][{{1}, {2, 3}}]
Out[1]=

Properties and Relations (1) 

TrimLeft removes elements from the left:

In[2]:=
ResourceFunction["TrimLeft"][{{1}, {2, 3}}]
Out[2]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 05 February 2019

Related Resources

License Information