StringContainsQ

StringContainsQ["string",patt]

yields True if any part of string matches the string pattern patt, and yields False otherwise.

StringContainsQ[{"string1","string2",},patt]

gives a list of the results for each of the stringi.

StringContainsQ[patt]

represents an operator form of StringContainsQ that can be applied to an expression.

Details and Options

Examples

open allclose all

Basic Examples  (3)

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

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

Give a list of strings as input:

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

Map an operator form over a list:

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

Options  (1)

See Also

StringCount  StringCases  StringPosition  StringStartsQ  StringEndsQ  StringDelete  StringExpression  RegularExpression

Introduced in 2015
(10.1)