String..::..Replace Method (String, String)
Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.
Namespace:
SystemAssembly: Bridge (in Bridge.dll)
Syntax
[TemplateAttribute] public string Replace( string substr, string newSubStr )
<TemplateAttribute> _ Public Function Replace ( _ substr As String, _ newSubStr As String _ ) As String
[TemplateAttribute] public: String^ Replace( String^ substr, String^ newSubStr )
Return Value
A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged.Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | oldValue is null. |
System..::..ArgumentException | oldValue is the empty string (""). |