This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

StringReplaceList

StringReplaceList["string", s->sp] or StringReplaceList["string", {s1->sp1, s2->sp2, ...}]
gives a list of the strings obtained by replacing each individual occurrence of substrings in "string" matching the string expressions si.
StringReplaceList["string", srules, n]
gives a list of the first n results obtained.
StringReplaceList[{s1, s2, ...}, srules]
gives the list of results for each of the si.
  • The string expressions si can contain any of the objects specified in the notes for StringExpression.
  • In each of the results returned by StringReplaceList only one substring has been replaced.
  • StringReplaceList goes through a string, testing substrings that start at each successive character position. On each substring, it tries in turn each of the transformation rules you have specified, returning a result for each one that applies.
  • StringReplaceList in effect carries out a single step in the evolution of a multiway system.
  • In replacements of the form si:>spi, the spi are not evaluated until each time they are used.
New in 5.1