(Print this page)

New article: Comparing Text to highlight differences in .Net
Published date: Sunday, June 21, 2020
On: Moer and Éric Moreau's web site

In the last few weeks, I needed a feature that would compare the text of two side-by-side RichTextBox controls. I wanted the differences to be highlighted. I also wanted the RichTextBox controls to scroll in sync to ease the comparison.

I was not really surprised to find snippets of code here and there doing all that but nothing combining the 3 requirements all together.

The most complex task of these 3 is that text comparison. I found a free library dedicated for that task. This library called “Diff Match Patch” is made available by Google on their github page.

Figure 1: The demo application in action

You can read the full article from https://www.emoreau.com/Entries/Articles/2020/06/Comparing-Text-to-highlight-differences-in-Net.aspx.


(Print this page)