This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# StringReplacePart

 StringReplacePartreplaces the characters at positions m through n in by . StringReplacePartinserts copies of at several positions. StringReplacePartreplaces characters at positions through in by .
• 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 , before any replacements have been done.
Replace characters 2 through 5 with a new string:
Replace several sequences of characters with a new string:
Replace characters 2 through 5 with a new string:
 Out[1]=

Replace several sequences of characters with a new string:
 Out[1]=
 Scope   (2)
Negative positions count from the end:
Replace two sequences of characters with two new strings:
 Applications   (1)
Simulating a multiway system
The evolution of a multiway system:
StringReplacePart can use the output from StringPosition:
This is equivalent to StringReplace:
Replacing with an empty string is equivalent to StringDrop:
StringReplacePart can drop several sequences of characters at a time:
Use position to insert at position n, without overwriting anything:
StringInsert can do the same:
The position specifications are not allowed to overlap:
New in 3