Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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)
Syntax
'Declaration
Public Function Replace ( _
oldChar As Char, _
newChar As Char _
) As StringBuilder
public StringBuilder Replace(
char oldChar,
char newChar
)
public:
StringBuilder^ Replace(
wchar_t oldChar,
wchar_t newChar
)
member Replace :
oldChar:char *
newChar:char -> StringBuilder
public function Replace(
oldChar : char,
newChar : char
) : StringBuilder
Parameters
- oldChar
Type: System. . :: . .Char
The character to replace.
- newChar
Type: System. . :: . .Char
The character that replaces oldChar.
Return Value
Type: System.Text. . :: . .StringBuilder
A reference to this instance with oldChar replaced by newChar.
Remarks
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.