StringExtensionsReplace(String, String, String, Int32, Int32, StringComparison, Int32) Method

Replaces all occurrences of a specified string with another specified string.

Definition

Namespace: PCBI_CadanceFab_Import
Assembly: PCBI_CadanceFab_Import (in PCBI_CadanceFab_Import.dll) Version: 16.0.0.0 (16.0.0.0)
C#
public static string Replace(
	this string input,
	string oldValue,
	string newValue,
	int startIndex,
	int count,
	StringComparison comparisonType,
	out int total
)

Parameters

input  String
The input string to replace for
oldValue  String
The string to replace
newValue  String
The string that replaces oldValue.
startIndex  Int32
The position in this instance where the substring begins
count  Int32
The length of the substring.
comparisonType  StringComparison
The way startsWith should be compared to the input string
total  Int32
The total amount of input values that have been replaced

Return Value

String
A reference to this instance with all instances of oldValue replaced by newValue in the range from startIndex to startIndex + total - 1

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