jimbob_sf
asked on
text compare in C#
Our application is written in C# .Net version 3.5. Part of our application is dedicated to displaying the user difference between 2 strings. Currently using the existing string functions of C#, we have the ability to let the user know the 2 strings are different. But, we want to let the user know more detail about the actual difference.
We would like the ability to color code the differences just like a file comparison tool does. In addition, it should highlight individual text differences and not just the full line. We have done some research to find a few tools out there that do this, but nothing that can be fully integrated within our C# application. By complete integration I mean, the ability to do the compare and show the color highlighted results in a 2 text boxes, side by side.
Any suggestions of existing tools that can be incorporated within C# will be appreciated.
We would like the ability to color code the differences just like a file comparison tool does. In addition, it should highlight individual text differences and not just the full line. We have done some research to find a few tools out there that do this, but nothing that can be fully integrated within our C# application. By complete integration I mean, the ability to do the compare and show the color highlighted results in a 2 text boxes, side by side.
Any suggestions of existing tools that can be incorporated within C# will be appreciated.
If you want to do it on just one line, I think you would have to go character by character to see if there is a difference....
Here is the code -
string temp1 = "string";
string temp2 = "stringRemain";
string result = temp2.Replace(temp1,"");
Highlight "result " part and "String.concat" with original one.
string temp1 = "string";
string temp2 = "stringRemain";
string result = temp2.Replace(temp1,"");
Highlight "result " part and "String.concat" with original one.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
here is the Diff Sample:
http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html
http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html
In our company we use Beyond Compare" product from http://www.scootersoftware.com/. It's not free however ($30 per one copy) ...
http://www.codeproject.com/KB/recipes/diffengine.aspx