C#的Diff算法文本 [英] C# Diff Algorithm for Text

查看:156
本文介绍了C#的Diff算法文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个差异算法,将产生像这样的编辑修改页面的结果。我已经或多或少刚开始看,我不反对这样做我自己,但我并不需要推倒重来。

I'm looking for a diff algorithm that will produce results like SO's edit revisions page. I've more or less just started looking and I'm not opposed to doing it myself but I don't need to reinvent the wheel.

我将使用C#4.0。我主要有两个字符串,和旧的和新的。我想知道通过强调和罢工得来什么,在新的改变。

I'll be using C# 4.0. I'll basically have two strings, and old one and a new one. I want to know what has changed in the new one by highlighting and strike throughs.

推荐答案

您可以看看 Menees的Diff 以C#编写的一个例子。

You can take a look at Menees Diff for an example written in C#.

这篇关于C#的Diff算法文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆