WordSeparators

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

DetailsDetails

  • The default setting is WordSeparators->{" ", "\t"}.
  • Strings used as word separators may contain several characters.
  • With the option setting NullWords->False, 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.
  • Strings given as record separators are automatically taken as word separators.

ExamplesExamplesopen allclose all

Basic Examples (1)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]=
New in 2
New to Mathematica? Find your learning path »
Have a question? Ask support »