WLJS LogoWLJS Notebook

StringExpression

s1 ~~ s2 ~~ ... or StringExpression[s1, s2, ...] represents a sequence of strings and symbolic string objects si.

Examples

Create a string pattern:

StringMatchQ["abc123", LetterCharacter ~~ LetterCharacter ~~ LetterCharacter ~~ DigitCharacter ..]
(* True *)

Use in StringCases:

StringCases["The cat sat", "c" ~~ __ ~~ "t"]
(* {"cat sat"} *)

Please visit the official Wolfram Language Reference for more details.

On this page