Replace Method (Char, Char, Int32, Int32)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Replaces, within a substring of this instance, all occurrences of a specified character with another specified character.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
public: StringBuilder^ Replace( wchar_t oldChar, wchar_t newChar, int startIndex, int count )
Parameters
- oldChar
- Type: System..::..Char
The character to replace.
- newChar
- Type: System..::..Char
The character that replaces oldChar.
- startIndex
- Type: System..::..Int32
The position in this instance where the substring begins.
- count
- Type: System..::..Int32
The length of the substring.
Return Value
Type: System.Text..::..StringBuilderA reference to this instance with oldChar replaced by newChar in the range from startIndex to startIndex + count -1.
The size of the StringBuilder is unchanged because characters are only replaced. This method is case-sensitive.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.
Show: