Returns a new string in which a specified string is inserted at a specified index position in this instance.
A new string that is equivalent to this instance, but with value inserted at position startIndex.
Type Reason ArgumentNullException value is a null reference. ArgumentOutOfRangeException startIndex is greater than the length of the current instance.
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".