({{, (RefLink[StartOfString, paclet:ref/StartOfString]) 
represents the start of a string for purposes of matching in (RefLink[StringExpression, paclet:ref/StringExpression]).}})

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Test whether a string starts with an "a":

StringMatchQ["abaababba",StartOfString~~"a"~~__]

Replace the first letter in a string:

StringReplace["ababbabbaaab", StartOfString ~~ LetterCharacter  -> "t"]

Remove the leading spaces:

StringReplace["  Have a nice day.  ",(StartOfString ~~Whitespace) ->  ""]//FullForm

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[EndOfString, paclet:ref/EndOfString])  ▪  (RefLink[StartOfLine, paclet:ref/StartOfLine])  ▪  (RefLink[StringExpression, paclet:ref/StringExpression])  ▪  (RefLink[StringStartsQ, paclet:ref/StringStartsQ])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[String Patterns, paclet:tutorial/StringPatterns])}, {▪(RefLinkPlain[Working with String Patterns, paclet:tutorial/WorkingWithStringPatternsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[String Patterns, paclet:guide/StringPatterns])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/42-string-patterns-and-templates.html])(WebLink[: String Patterns and Templates , https://www.wolfram.com/language/elementary-introduction/42-string-patterns-and-templates.html])}})}})