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:

Scope  (1)

Construct a parser for Wolfram Language matrices:

Applications  (1)

Use DelimitedSequence in a form to accept a simple list of elements:

Possible Issues  (2)

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:

When DelimitedSequence fails to parse an element in the sequence the whole result is a Failure object:

Wolfram Research (2014), DelimitedSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/DelimitedSequence.html (updated 2016).

Text

Wolfram Research (2014), DelimitedSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/DelimitedSequence.html (updated 2016).

CMS

Wolfram Language. 2014. "DelimitedSequence." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/DelimitedSequence.html.

APA

Wolfram Language. (2014). DelimitedSequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DelimitedSequence.html

BibTeX

@misc{reference.wolfram_2024_delimitedsequence, author="Wolfram Research", title="{DelimitedSequence}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/DelimitedSequence.html}", note=[Accessed: 15-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_delimitedsequence, organization={Wolfram Research}, title={DelimitedSequence}, year={2016}, url={https://reference.wolfram.com/language/ref/DelimitedSequence.html}, note=[Accessed: 15-October-2024 ]}