Wolfram Computation Meets Knowledge

TrimRight

Contributed by: Taliesin Beynon

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

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

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

Examples

Basic Examples

Trim the lists by removing elements from the right:

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

Properties and Relations

TrimRight removes elements from the right:

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

Resource History