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

Documentation / Mathematica / Built-in Functions / Programming / String Manipulation /

StringReplace

FilledSmallSquare StringReplace["string", "" -> ""] or StringReplace["string", "" -> "", "" -> "", ... ] replaces the "" by "" whenever they appear as substrings of "string".

FilledSmallSquare StringReplace 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. If any of the rules apply, it replaces the substring, then continues to go through the string, starting at the character position after the end of the substring.

FilledSmallSquare Delayed replacements of the form "s" :> expr can be given, so long as expr evaluates to a string every time the replacement is used.

FilledSmallSquare Setting the option IgnoreCase -> True makes StringReplace treat lower- and upper-case letters as equivalent.

FilledSmallSquare See Section 2.8.2.

FilledSmallSquare See also: Replace, StringReplacePart, StringPosition, ToLowerCase, ToUpperCase.

FilledSmallSquare New in Version 2; modified in 4.

Further Examples