This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / New in Version 3.0 / Programming  /
StringReplacePart

  • StringReplacePart[" string ", " snew ", m , n ] replaces the characters at positions m through n in " string " by " snew ".
  • StringReplacePart[" string ", " snew ", , , , , ... ] inserts copies of " snew " at several positions.
  • StringReplacePart[" string ", " ", " ", ... , , , , , ... ] replaces characters at positions through in " string " by " ".
  • StringReplacePart uses position specifications in the form returned by StringPosition.
  • When a list of " " is given, its length must be the same as the length of the list of positions.
  • When multiple positions are given, all refer to the original " string ", before any replacements have been done.
  • StringReplacePart[ s , "", ... ] can be used to delete substrings.
  • See the Mathematica book: Section 2.7.2.
  • See also: StringInsert, StringDrop, StringReplace, StringJoin, ReplacePart.