Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Test if the first elements of a list are the same as those from another list
ResourceFunction["PrefixQ"][list1,list2] gives True if list2 is a prefix of list1. | |
ResourceFunction["PrefixQ"][list2] is the operator form of ResourceFunction["PrefixQ"]. |
The second list starts with the same two elements of the first:
In[1]:= |
Out[1]= |
A list with other elements:
In[2]:= |
Out[2]= |
A non-prefix list:
In[3]:= |
Out[3]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License