StringInsert["string","snew",n]
yields a string with "snew" inserted starting at position n in "string".
StringInsert["string","snew",-n]
inserts at position n from the end of "string".
StringInsert["string","snew",{n1,n2,…}]
inserts a copy of "snew" at each of the positions ni.
StringInsert[{s1,s2,…},"snew",n]
gives the list of results for each of the si.


StringInsert
StringInsert["string","snew",n]
yields a string with "snew" inserted starting at position n in "string".
StringInsert["string","snew",-n]
inserts at position n from the end of "string".
StringInsert["string","snew",{n1,n2,…}]
inserts a copy of "snew" at each of the positions ni.
StringInsert[{s1,s2,…},"snew",n]
gives the list of results for each of the si.
Details

- StringInsert["string","snew",n] makes the first character of snew the
character in the new string.
- StringInsert["string","snew",-n] makes the last character of snew the
character from the end of the new string.
- In StringInsert["string","snew",{n1,n2,…}] the ni are taken to refer to positions in "string" before any insertion is done. »
- StringInsert[BioSequence["type","seq"],…] will apply the operation to the string "seq", yielding a BioSequence result.
Examples
open all close allScope (3)
Properties & Relations (2)
Possible Issues (2)
The positions refer to the original string, not the final one:
StringInsert operates on the raw characters in a string:
Tech Notes
Related Guides
History
Introduced in 1991 (2.0) | Updated in 1996 (3.0) ▪ 2004 (5.1) ▪ 2020 (12.2)
Text
Wolfram Research (1991), StringInsert, Wolfram Language function, https://reference.wolfram.com/language/ref/StringInsert.html (updated 2020).
CMS
Wolfram Language. 1991. "StringInsert." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/StringInsert.html.
APA
Wolfram Language. (1991). StringInsert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringInsert.html
BibTeX
@misc{reference.wolfram_2025_stringinsert, author="Wolfram Research", title="{StringInsert}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/StringInsert.html}", note=[Accessed: 09-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_stringinsert, organization={Wolfram Research}, title={StringInsert}, year={2020}, url={https://reference.wolfram.com/language/ref/StringInsert.html}, note=[Accessed: 09-August-2025]}