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 Options

- The string expression patt can contain any of the objects specified in the notes for StringExpression.
- Setting the option IgnoreCase->True makes StringFreeQ treat lowercase and uppercase letters as equivalent.
- StringFreeQ[patt][expr] is equivalent to StringFreeQ[expr,patt].
- StringFreeQ[BioSequence["type","seq"],patt] will check 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 StringFreeQ is circular, wraparound matches are possible.
Examples
open allclose allBasic Examples (3)
Test whether a string pattern contains a substring matching the pattern:
Check that a string is free of "a":
Use the operator form of StringFreeQ:
Scope (10)
Mixed regular expressions and string patterns:
Occurrences of either pattern:
StringFreeQ automatically threads over lists of strings:
Check whether a biomolecular sequence is free of a particular substring:
Use a wildcard in the pattern compared against a biomolecular sequence:
The "N" is a degenerate letter:
Check for the absence of literal degenerate letters using Verbatim:
Options (2)
IgnoreCase (2)
Use IgnoreCase->True to check for the presence of substrings regardless of case:
Applications (1)
Properties & Relations (3)
StringMatchQ checks whether a whole string matches a pattern:
StringFreeQ checks whether a substring matches a pattern:
Get the starting and ending positions where a substring occurs by using StringPosition:
Use StringCases to extract substrings matching a given pattern:
Text
Wolfram Research (2004), StringFreeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/StringFreeQ.html (updated 2020).
CMS
Wolfram Language. 2004. "StringFreeQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/StringFreeQ.html.
APA
Wolfram Language. (2004). StringFreeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringFreeQ.html