StringEndsQ

StringEndsQ["string",patt]

yields True if the end of string matches the string pattern patt, and yields False otherwise.

StringEndsQ[{"string1","string2",},patt]

gives a list of the results for each of the stringi.

StringEndsQ[patt]

represents an operator form of StringEndsQ that can be applied to an expression.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Check that a string ends with a given suffix:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Give a list of strings as input:

In[1]:=
Click for copyable input
Out[1]=

Specify a suffix using a string pattern:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Map the operator form over a list:

In[1]:=
Click for copyable input
Out[1]=

Use the operator form to select strings:

In[2]:=
Click for copyable input
Out[2]=

Options  (1)

See Also

StringStartsQ  StringTake  StringContainsQ  EndOfString  StringExpression  RegularExpression

Introduced in 2015
(10.1)