A StringBuilder with all instances of a specified character string replaced with a new character string.
[Visual Basic] Overloads Public Function Replace( _ ByVal oldValue As String, _ ByVal newValue As String _ ) As StringBuilder [C#] public StringBuilder Replace( string oldValue, string newValue ); [C++] public: StringBuilder* Replace( String* oldValue, String* newValue ); [JScript] public function Replace( oldValue : String, newValue : String ) : StringBuilder;
A reference to the current StringBuilder with all instances of oldValue replaced with newValue.
Exception Type | Condition |
---|---|
ArgumentNullException | if oldValue is a null reference (in Visual Basic Nothing). |
The strings to be replaced are checked on an ordinal basis (e.g. not locale aware). If newValue is null, instances of oldValue are removed (e.g. replaced with nothing.). This method is case-sensitive.
StringBuilder Class | StringBuilder Members | System.Text Namespace | StringBuilder.Replace Overload List