WLJS LogoWLJS Notebook

StringFreeQ

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

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

Examples

Check if string is free of a pattern:

StringFreeQ["Hello World", "xyz"]
(* True *)

Check for digit characters:

StringFreeQ["Hello World", DigitCharacter]
(* True *)
StringFreeQ["Hello123", DigitCharacter]
(* False *)

Please visit the official Wolfram Language Reference for more details.

On this page