InsertString(string, string, int)

This function will insert a string into the destination string at the position indicated by nPosition.

string InsertString(
    string sDestination,
    string sString,
    int nPosition
);

Parameters

sDestination

String to insert into.

sString

String to insert.

nPosition

Index position to insert at.


Description

This function inserts a string into another string.



Remarks

Prior to version 1.26 this function would instead overwrite vice insert.


Version

1.26

Example

string s1 = "Bacon and spam";
string s2 = ", ham ";
string s3 = InsertString(s1, s2, 6);
//s3 = "Bacon, ham and spam"

See Also

categories: String Functions


 author: Michael Nork, editors: Charles Feduke, Mistress, additional contributors: Iceberg, Fireboar