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


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


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

Details and Options

  • The string expression patt can contain any of the objects specified in the notes for StringExpression.
  • Setting the option IgnoreCase->True makes StringContainsQ treat lowercase and uppercase letters as equivalent.
  • StringContainsQ[patt][expr] is equivalent to StringContainsQ[expr,patt].
  • StringConstainsQ[BioSequence["type","seq"],patt] checks the string "seq" against patt. In this case, degenerate letters in patt are interpreted as wildcard patterns based on the type of biomolecular sequence. Use Verbatim["patt"] to match degenerate letters literally.
  • The documentation for BioSequence lists the degenerate letters supported by each type of biomolecular sequence.
  • If the biomolecular sequence operated upon by StringContainsQ is circular, wraparound matches are possible.


open allclose all

Basic Examples  (3)

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

Give a list of strings as input:

Map an operator form over a list:

Scope  (4)

Find whether a genetic sequence contains a particular subsequence:

Use a wildcard in the pattern compared against a BioSequence:

The "N" is a degenerate letter only in biomolecular sequences:

Check for literal degenerate letters using Verbatim:

Circular sequences support wraparound checks:

Options  (1)

IgnoreCase  (1)

Match substrings regardless of case:

Wolfram Research (2015), StringContainsQ, Wolfram Language function, (updated 2020).


Wolfram Research (2015), StringContainsQ, Wolfram Language function, (updated 2020).


Wolfram Language. 2015. "StringContainsQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020.


Wolfram Language. (2015). StringContainsQ. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2022_stringcontainsq, author="Wolfram Research", title="{StringContainsQ}", year="2020", howpublished="\url{}", note=[Accessed: 26-September-2022 ]}


@online{reference.wolfram_2022_stringcontainsq, organization={Wolfram Research}, title={StringContainsQ}, year={2020}, url={}, note=[Accessed: 26-September-2022 ]}