WordSeparators

WordSeparators

is an option for Read, Find, and related functions that specifies the list of strings to be taken as delimiters for words.

Details

  • The default setting is WordSeparators{" ","t"}.
  • Strings used as word separators may contain several characters.
  • With the option setting NullWordsFalse, any number of word separators may appear between any two successive words.
  • WordSeparators{{lsep1,},{rsep1,}} specifies different left and right separators for words. Words must have a left separator at the beginning, a right separator at the end, and cannot contain any separators.
  • WordSeparators{} or WordSeparatorsNone does not use word separators, so any record is effectively read as a single word.
  • Strings given as record separators are automatically taken as word separators.

Examples

open allclose all

Basic Examples  (1)

Read the text in a file as a sequence of words:

Use WordSeparators:

Scope  (1)

Setting WordSeparatorsNone is equivalent to reading a record:

Wolfram Research (1991), WordSeparators, Wolfram Language function, https://reference.wolfram.com/language/ref/WordSeparators.html (updated 2017).

Text

Wolfram Research (1991), WordSeparators, Wolfram Language function, https://reference.wolfram.com/language/ref/WordSeparators.html (updated 2017).

CMS

Wolfram Language. 1991. "WordSeparators." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/WordSeparators.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_wordseparators, author="Wolfram Research", title="{WordSeparators}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/WordSeparators.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_wordseparators, organization={Wolfram Research}, title={WordSeparators}, year={2017}, url={https://reference.wolfram.com/language/ref/WordSeparators.html}, note=[Accessed: 30-December-2024 ]}