StringFreeQ

StringFreeQ["string",patt]
yields True if no substring in "string" matches the string expression patt, and yields False otherwise.

StringFreeQ["string",{patt1,patt2,}]
yields True if no substring matches any of the patti.

StringFreeQ[{s1,s2,},p]
gives the list of results for each of the si.

StringFreeQ[patt]
represents an operator form of StringFreeQ that can be applied to an expression.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Test whether a string pattern contains a substring matching the pattern:

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

Check that a string is free of "a":

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

Use the operator form of StringFreeQ:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2004
(5.1)
| Updated in 2016
(10.4)
Translate this page: