gives a list of the strings obtained by replacing each individual occurrence of substrings in "string" matching the string expressions si.
gives a list of the first n results obtained.
gives the list of results for each of the si.
Details and Options
- 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.
- If the spi in the replacements si->spi do not evaluate to strings, StringReplaceList will yield a StringExpression rather than an ordinary string.
- In replacements of the form si:>spi, the spi are not evaluated until each time they are used.
- Setting the option IgnoreCase->True makes StringReplaceList treat lowercase and uppercase letters as equivalent.
Examplesopen allclose all
Use RuleDelayed (:>) in order to evaluate the right-hand side of a rule:
StringReplaceList works on special characters:
StringReplaceList automatically threads over lists of strings:
Five steps in the evolution of the Fibonacci multiway system [more info]: