DelimitedSequence

DelimitedSequence[form]

represents a delimited sequence of elements of the specified form in Interpreter and related functions.

DelimitedSequence[form,sep]

assumes a separator that matches sep.

DelimitedSequence[form,{left,sep,right}]

assumes left and right delimiters matching left and right, respectively.

Details

  • DelimitedSequence[form] allows any sequence of objects of type form separated by white space or punctuation in a way that cannot occur inside the objects.
  • The separator sep and delimiters left and right can be literals or string patterns.
  • Restricted can be used to put restrictions on the length of the sequence.

Examples

open allclose all

Basic Examples  (5)

Interpret a list of integers:

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

Various delimiters are allowed:

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

Require comma-separated integers:

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

Require a parenthesized list:

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

Interpret a list of cities:

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

Interpret a sequence of 3 digits:

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

Possible Issues  (1)

See Also

RepeatingElement  CompoundElement  Interpreter  Riffle  StringExpression  StringTemplate  Repeated

Introduced in 2014
(10.0)