StringBuilderReplace Method (String, String) |
Replaces all occurrences of a specified string in this instance with another specified string.
Namespace: System.TextAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public StringBuilder Replace(
string oldValue,
string newValue
)
Parameters
- oldValue
- Type: SystemString
The string to replace. - newValue
- Type: SystemString
The string that replaces oldValue, or null.
Return Value
Type:
StringBuilderA reference to this instance with all instances of
oldValue replaced by
newValue.
Exceptions Exception | Condition |
---|
ArgumentNullException | oldValue is null. |
ArgumentException | The length of oldValue is zero. |
ArgumentOutOfRangeException | Enlarging the value of this instance would exceed MaxCapacity. |
See Also