StringPosition

StringPosition["string", "sub"]
gives a list of the starting and ending character positions at which appears as a substring of .

StringPosition["string", patt]
gives all positions at which substrings matching the general string expression patt appear in .

StringPosition["string", patt, n]
includes only the first n occurrences of patt.

StringPosition["string", {patt1, patt2, ...}]
gives positions of all the .

StringPosition[{s1, s2, ...}, p]
gives the list of results for each of the .

Details and OptionsDetails and Options

New in 2 | Last modified in 5.1
New to Mathematica? Find your learning path »
Have a question? Ask support »