StringBuilder.Replace Method (String, String)

Replaces all occurrences of a specified string in this instance with another specified string.

Namespace: System.Ext.Text
Assembly: MFDpwsExtensions (in mfdpwsextensions.dll)

Syntax

public StringBuilder Replace (
         stringsearchString,
         stringreplaceString
)

Parameters

  • searchString
    The string to replace.
  • replaceString
    The string that replaces oldValue, or null.

Return Value

A reference to this instance with all instances of oldValue replaced by newValue.

Exceptions

Exception type Condition
ArgumentNullException oldValue is null.
ArgumentOutOfRangeException Enlarging the value of this instance would exceed MaxCapacity.
ArgumentException The length of oldValue is zero.

Version Information

Available in the .NET Micro Framework versions 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

StringBuilder Class
StringBuilder Members
System.Ext.Text Namespace