Click or drag to resize

ExtensionsReplaceMe Method (String, Char, Char, Int32)

Replaces a char oldChar with the char newChar.

ATTENTION: The original string is the target of the manipulation.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static void ReplaceMe(
	this string value,
	char oldChar,
	char newChar,
	int startingIndex = 0
)

Parameters

value
Type: SystemString
The string with the chars to replace
oldChar
Type: SystemChar
The old char to be replaced by newChar
newChar
Type: SystemChar
The new char that replaces the old chars
startingIndex (Optional)
Type: SystemInt32
The index where to start replacing chars

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).
Exceptions
ExceptionCondition
ArgumentNullExceptionvalue is null
ArgumentOutOfRangeExceptionstartingIndex is higher than value length
See Also