String.Insert Method (Int32, String)
Returns a new string in which a specified string is inserted at a specified index position in this instance.
Assembly: mscorlib (in mscorlib.dll)
The zero-based index position of the insertion.
The string to insert.
Return ValueType: System.String
A new string that is equivalent to this instance, but with value inserted at position startIndex.
If startIndex is equal to the length of this instance, value is appended to the end of this instance.
This method does not modify the value of the current instance. Instead, it returns a new string in which value is inserted into the current instance.
For example, the return value of "abc".Insert(2, "XYZ") is "abXYZc".
The following example inserts a space character in the fourth character position (the character at index 3) of a string.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1