This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# StringPosition

 StringPositiongives a list of the starting and ending character positions at which appears as a substring of . StringPositiongives all positions at which substrings matching the general string expression patt appear in . StringPositionincludes only the first n occurrences of patt. StringPositiongives positions of all the . StringPositiongives the list of results for each of the .
• The string expression patt can contain any of the objects specified in the notes for StringExpression.
• With Overlaps->All, multiple substrings that match the same string expression are all included. With Overlaps->True, only the first such matching substring at a given position is included. »
Find the starting and ending positions at which "XYZ" occurs in a string:
Find where any pairs of identical characters occur:
Find the starting and ending positions at which "XYZ" occurs in a string:
 Out[1]=

Find where any pairs of identical characters occur:
 Out[1]=
 Scope   (4)
StringPosition gives substring positions in the form used by functions like StringTake:
Find the position of the first occurrence of "XYZ":
StringPosition by default includes overlaps:
Use Overlaps->False to exclude overlaps:
 Options   (4)
Treat "a" and "A" as the same:
Treat "a" and "A" as different:
Find successive identical characters independent of case:
StringPosition by default includes overlaps:
By default, StringPosition only includes one substring starting at any given position:
With Overlaps->All, it includes all substrings:
 Applications   (2)
Find positions of pairs of identical letters in a concatenation sequence:
Find an analogous curve for triples:
Find the positions of the word "president" in the U.S. Constitution:
Use StringTake to extract substrings found by StringPosition:
StringCases by default excludes overlaps:
Use StringReplacePart to replace at positions found by StringPosition:
Lists of string patterns in StringPosition are sometimes not the same as pattern alternatives: