We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Problem with IWorksheet.Replace()

Hi,

the IWorksheet.Replace() method only seems to find whole strings. How can I search (and replace) for a part of a string?

E.g. a cell on the worksheet "sheet" contains the text "Current database: @database". After executing the command:

sheet.Replace("@database", "Test-DB");

... the text in the cell sould be:
"Current database: Test-DB"

In MS Excel, we used this command to get the desired functionality:

sheet.Cells.Replace(findText, replaceText, XlLookAt.xlPart, XlSearchOrder.xlByRows, false/*MatchCase*/, /*MatchByte*/false);

Thanks & best regards
Christian

1 Reply

MW Melba Winshia Syncfusion Team July 17, 2007 08:39 AM UTC

Hi Christian,

Thank you for your interest in Essential XlsIO.

Currently it is possible only to find whole strings and it is not possible to search for a part of a string. We have already logged "Feature to find and replace for a part of a string" as a feature request and notified our development team. We will implement this feature in our forthcoming new version releases or service pack releases. We usually have a timeframe of at least three months between releases. The feature implementation would also greatly depend on the factors like product design, code compatibility and complexity. We will get back to you once the feature is implemented.

Please let me know if you have any more questions.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon