StartOfLine

StartOfLine
represents the start of a line in a string for purposes of matching in StringExpression.

DetailsDetails

  • StartOfLine is taken to occur at the beginning of a string, and immediately after every newline in the string.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Split a string at the beginning of a line:

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

Find how many lines start with "We the People" in the U.S. Constitution:

In[1]:=
Click for copyable input
Out[1]=
New in 5.1
New to Mathematica? Find your learning path »
Have a question? Ask support »