WLJS LogoWLJS Notebook

StringContainsQ

StringContainsQ["string", patt] yields True if any substring matches the pattern.

StringContainsQ[patt] represents an operator form.

Examples

Check for substring:

StringContainsQ["Hello World", "World"]
(* True *)
StringContainsQ["Hello World", "Goodbye"]
(* False *)

With patterns:

StringContainsQ["abc123", DigitCharacter]
(* True *)

Please visit the official Wolfram Language Reference for more details.

On this page