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 string in this instance with another specified string.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Function Replace ( _
oldValue As String, _
newValue As String _
) As StringBuilder
public StringBuilder Replace(
string oldValue,
string newValue
)
public:
StringBuilder^ Replace(
String^ oldValue,
String^ newValue
)
member Replace :
oldValue:string *
newValue:string -> StringBuilder
public function Replace(
oldValue : String,
newValue : String
) : StringBuilder
Parameters
- oldValue
Type: System. . :: . .String
The string to replace.
- newValue
Type: System. . :: . .String
The string that replaces oldValue, or nullNothingnullptrunita null reference (Nothing in Visual Basic).
Return Value
Type: System.Text. . :: . .StringBuilder
A reference to this instance with all instances of oldValue replaced by newValue.
Remarks
The strings to replace are checked on an ordinal basis; that is, the replacement is not culture-aware. If newValue is null Nothing nullptr unit a null reference (Nothing in Visual Basic) or String..::..Empty, all occurrences of oldValue are removed. 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.