开发者

Any existing C# code (OSS) that will calculate diff between two strings and output html? [closed]

Closed. This question does not meet Stack O开发者_StackOverflowverflow guidelines. It is not currently accepting answers.

Closed 9 years ago.

  • Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
  • Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question

I need to compare two strings and output the diff in HTML (similar to MS Word "track changes"). Language is C#, this is (not surprisingly) a .NET web app. There are a few similar questions (like this one for PHP/Python), but no existing question on SO.

I don't need a finished project, just anything that will cut out the extra work. I know this problem has been solved at least once. I'm looking to leverage from that starting place (source for an object, just a method, just an algorithm in C#, anything will be useful). Output for the diff needs to be in HTML.


There is a C# class available from here (under a BSD licence) that will diff two textual inputs. If you download the source code, there is also some code that will turn this output into HTML. An example of its output can be found here.


DiffPlex and Google Diff Match and Patch (via prettyHtml function) are some other open source options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜