Mono Class Library: System.Text.StringBuilder Overview | Members

System.Text.StringBuilder.Replace Method

Replaces all instances of a specified string with another specified string. [Edit]

public StringBuilder Replace (string oldValue, string newValue)

Parameters

oldValue
A string containing the string value to replace. [Edit]
newValue
A string containing the string value with which to replace oldValue. Can be a null reference. [Edit]

Returns

The current instance after substitution has occurred. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionoldValue is a null reference. [Edit]
ArgumentExceptionThe length of oldvalue is zero. [Edit]

Remarks

This method substitutes each occurrence of oldValue in the current instance with newValue.

Note: If newValue is null , instances of oldValue are removed.

This method is case-sensitive.

[Edit]

Requirements

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0