xlsgen > overview > Search and Replace


Search/Replace with xlsgen

xlsgen can search and replace words across entire worksheets. The ease of use of this feature defies simplicity :

// replace "word" by "ppt" in all cells within the range boundaries
worksheet.NewRange("C3:I9").SearchAndReplace("word", "ppt");

When the method call is made, it applies to a range which can be as large as a worksheet, all based on the client application needs. Replacements will only occur within the range boundaries.

The method call actually returns how many replacements have occured making it easy to track the evolution of the contents of the worksheet.

// replace "word" by "ppt" in all cells within the range boundaries
int nbReplacements = worksheet.NewRange("C3:I9").SearchAndReplace("word", "ppt");

Note that the search/replace feature is disabled in trial mode. This is to prevent bargain uses of the software.

Search/replace isn't case sensitive and preserves the cell styles.

 

xlsgen documentation. © ARsT Design all rights reserved.