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:

Various delimiters are allowed:

Require comma-separated integers:

Require a parenthesized list:

Interpret a list of cities:

Interpret a sequence of 3 digits:

Possible Issues  (1)

DelimitedSequence of all types that use the connection to the Wolfram Cloud will only use a semicolon as an automatic delimiter, to avoid confusion with natural-language names of elements:

You can still explicitly specify delimiters:

Introduced in 2014
 (10.0)
 |
Updated in 2016
 (10.4)