StringInsert
StringInsert["string","snew",n]
yields a string with "snew" inserted starting at position in "string".
StringInsert["string","snew",-n]
inserts at position from the end of "string".
StringInsert["string","snew",{n1,n2,…}]
inserts a copy of "snew" at each of the positions .
StringInsert[{s1,s2,…},"snew",n]
gives the list of results for each of the .
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 allclose 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:
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