[]
Wraps the optional parameters used by Replace(object, object, ReplaceOptions).
Use this class to configure how content is matched and replaced in a range, including whether the search matches the whole cell content or part of it, the search order, case sensitivity, double-byte matching, and optional search and replacement formats. This wrapper keeps the replace API consistent when optional settings are provided.
public class ReplaceOptions
Public Class ReplaceOptions
worksheet.Range["A1:A2"].Value = new object[,] {
{"Draft"},
{"Draft plan"}
};
ReplaceOptions options = new ReplaceOptions();
options.LookAt = LookAt.Whole;
worksheet.Range["A1:A2"].Replace("Draft", "Final", options);
| Name | Description |
|---|---|
| ReplaceOptions() |
| Name | Description |
|---|---|
| LookAt | Gets or sets how the search text is matched during a replace operation. |
| MatchByte | Gets or sets whether replacement matches double-byte characters only.
If this property is Use MatchByte to change this setting for Replace(object, object, ReplaceOptions) operations. |
| MatchCase | Gets or sets whether the search is case-sensitive.
This option controls whether Replace(object, object, ReplaceOptions)
matches letter case when searching text. The default value is |
| ReplaceFormat | Gets or sets the display format applied to replaced cells during a replace operation.
Returns the IDisplayFormat configured for
Replace(object, object, ReplaceOptions). When this property is not
|
| SearchFormat | Gets or sets the display format used as the search criterion during a replace operation.
Returns the IDisplayFormat used by Replace(object, object, ReplaceOptions)
to limit matching to cells whose displayed formatting matches the specified format.
The default value is |
| SearchOrder | Gets or sets the search order. The search order determines how a range is traversed during a replace operation. For example, ByRows searches across a row before moving to the next row, and ByColumns searches down a column before moving to the next column. |