Click or drag to resize

IWorksheet Replace Method (String, Int32 , Boolean)

Replaces specified string by data from array.
Examples
The following code snippet illustrates how to replace the string with array of int values:
<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 array of int values</para><para>string oldValue = "Find";</para><para>int[] newValues = { 1, 2 };</para><para>worksheet.Replace(oldValue, newValues, true);</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,
	int[] newValues,
	bool isVertical
)

Parameters

oldValue
Type: System String
String value to replace.
newValues
Type: System Int32
Array of new values.
isVertical
Type: System Boolean
Indicates whether array should be inserted vertically.
See Also