Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

StringStartsQ

StringStartsQ["string",patt]
yields True if the beginning of string matches the string pattern patt, and yields False otherwise.

StringStartsQ[{"string1","string2",},patt]
gives a list of the results for each of the stringi.

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

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Check that a string starts with a given prefix:

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

Give a list of strings as input:

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

Specify a prefix using a string pattern:

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

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]=
Introduced in 2015
(10.1)