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

StringInsert

StringInsert
yields a string with inserted starting at position in .
StringInsert
inserts at position from the end of .
StringInsert
inserts a copy of at each of the positions .
StringInsert
gives the list of results for each of the .
  • StringInsert makes the first character of snew the ^(th) character in the new string.
  • StringInsert makes the last character of snew the ^(th) character from the end of the new string.
  • In StringInsert the are taken to refer to positions in before any insertion is done. »
Insert "XYZ" after character position 4:
Insert "XYZ" after character position 4:
In[1]:=
Click for copyable input
Out[1]=
Insert "XYZ" starting 4 character positions from the end of the string:
Insert "XYZ" at several positions:
Insert a dot at every third character position:
Count from the end:
Insertion positions always refer to the original string:
Insert "XYZ" to start one character position after the end of the existing string:
An equivalent form:
The positions refer to the original string, not the final one:
StringInsert operates on the raw characters in a string:
New in 2 | Last modified in 5.1