StringExtensionsReplace Method |
Replace all instances of a specified System.String in this instance, with another specified System.String
using the specified comparison type. This allows for case-insensitive replacements.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static string Replace(
this string s,
string oldValue,
string newValue,
StringComparison comparisonType
)
<ExtensionAttribute>
Public Shared Function Replace (
s As String,
oldValue As String,
newValue As String,
comparisonType As StringComparison
) As String
Parameters
- s
- Type: SystemString
The string upon which to operate. - oldValue
- Type: SystemString
A System.String to be replaced. - newValue
- Type: SystemString
A System.String to replace all occurances of oldValue. - comparisonType
- Type: SystemStringComparison
The type of comparison to use when searching for instances of oldValue to replace.
Return Value
Type:
StringThe string with all occurances of oldValue replaced with newValue.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also