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:

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

Use WordSeparators:

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

Scope  (1)

See Also

RecordSeparators  TokenWords  NullRecords  Word

Tutorials

Introduced in 1991
(2.0)
| Updated in 2017
(11.2)