I need to select only the bold text in a RichTextBox in a winform application and then enclose it within brackets :
For example: The Rollup Action element describes the desired action that should be applied to the cluster activity that defines the Rollup Rule.
The bold text would become:. Thanks.
[Rollup Action] [Rollup Rule]
I need to select only the bold text in a RichTextBox in a winform
Share
One solution would be to use Regex to find the bold text and replace it with the same thing but with brackets added:
And the MatchEvaluator:
The output for your sample would be:
You can also update the regex to be sure it works ok in all cases.