StringFreeQ
Usage
Notes
Further Examples
This checks that a string is free of "a".
In[1]:=
|
Out[1]=
|
This checks that a string does not contain successive identical characters.
In[2]:=
|
Out[2]=
|
In[3]:=
|
Out[3]=
|
Here is the same test using regular expressions.
In[4]:=
|
Out[4]=
|
In[5]:=
|
Out[5]=
|
Using checks for the presence of substrings regardless of case.
In[6]:=
|
Out[6]=
|
In[7]:=
|
Out[7]=
|
Here is a list of strings and a list of patterns.
In[8]:=
|
In[9]:=
|
StringFreeQ gives True only for strings that do not contain the substrings "Al", "gene", or "rot".
In[10]:=
|
Out[10]=
|
The words Alexander, Dorothy and Eugene are not selected when we pick out the names that are not matched.
In[11]:=
|
Out[11]=
|
In[12]:=
|
|