StringBuilderExtensionReplace(StringBuilder, Char, Char, Int32) Method
Replaces, within a substring of builder, all occurrences
of a specified character with another specified character.
Namespace: FolkerKinzel.StringsAssembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
public static StringBuilder Replace(
this StringBuilder builder,
char oldChar,
char newChar,
int startIndex
)
<ExtensionAttribute>
Public Shared Function Replace (
builder As StringBuilder,
oldChar As Char,
newChar As Char,
startIndex As Integer
) As StringBuilder
public:
[ExtensionAttribute]
static StringBuilder^ Replace(
StringBuilder^ builder,
wchar_t oldChar,
wchar_t newChar,
int startIndex
)
[<ExtensionAttribute>]
static member Replace :
builder : StringBuilder *
oldChar : char *
newChar : char *
startIndex : int -> StringBuilder
- builder StringBuilder
- The StringBuilder whose content is changed.
- oldChar Char
- The character to replace.
- newChar Char
- The character that replaces oldChar.
- startIndex Int32
- The position in builder where the substring
begins.
StringBuilderA reference to
builder with
oldChar replaced by
newChar in the range from
startIndex to the end of
builder.In Visual Basic and C#, you can call this method as an instance method on any object of type
StringBuilder. 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).
This method performs an ordinal, case-sensitive comparison to identify occurrences
of oldChar in the current instance. The size of
builder is unchanged after the replacement.