Parsing and Replacing Strings

One of the most powerful and popular features of Regular Expressions is its ability to locate substrings within a string using a supplied pattern and then replace that substring with another. Obviously, this ability is useful in a multitude of applications—whether in document-based systems such as editors, where the user needs a sophisticated search and replace capability, or in complex text parsers. With the BCL classes, this functionality is provided by the Regex class. In fact, the Regex class has several instance and static overloaded versions of the Replace methods from which to choose, depending on the exact nature of your needs.

The static versions of these methods are provided because we often do not need ...

Get Extending MFC Applications with the .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.