Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

SequencePosition

SequencePosition[list,sublist]
gives a list of the starting and ending positions at which sublist appears in list.

SequencePosition[list,patt]
gives all positions at which sequences matching patt occur in list.

SequencePosition[list,patt,n]
includes only the first n occurrences of patt.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Find the positions of a sublist in a list:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Find the positions of all contiguous occurrences of b:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2015
(10.1)