Click or drag to resize

IWorksheet Replace Method (String, String)

Replaces specified string by specified value.
Examples
The following code snippet illustrates how to replace the string with another string:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by newValue</para><para>string oldValue = "Find";</para><para>string newValue = "NewValue";</para><para>worksheet.Replace(oldValue, newValue);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
void Replace(
	string oldValue,
	string newValue
)

Parameters

oldValue
Type: System String
String value to replace.
newValue
Type: System String
New value for the range with specified string.
See Also