Replace Method (Char, Char)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

Public Function Replace ( _
	oldChar As Char, _
	newChar As Char _
) As StringBuilder


Type: System..::..Char
The character to replace.
Type: System..::..Char
The character that replaces oldChar.

Return Value

Type: System.Text..::..StringBuilder
A reference to this instance with oldChar replaced by newChar.

A StringBuilder with all instances of oldChar replaced with newChar. The size of the StringBuilder is unchanged because characters are only replaced. This method is case-sensitive.