string class : Insert(int,string) method
Description
Gets a new string which a specified string is inserted at a specified position in this instance.
Syntax
stringInstance.Insert(int insertPosition ,string insertString)
Arguments
Class | Name | Description |
int | insertPosition | A insert position. |
string | insertString | A insert string. |
Return value
Class | Description |
string | A new string which a specified string is inserted at a specified position in this instance. |
Sample code
//anyString is a instance of string type.
string newString = anyString.Insert(5, "ww");
Notes
It's a wrapper of the System.String.Insert(Int32, String).
The index is zero-based.