Csharp component which generates fragments with highlights for diffs for 2 strings

Posted by MicMit on Stack Overflow See other posts from Stack Overflow or by MicMit
Published on 2010-03-18T00:34:16Z Indexed on 2010/03/18 1:01 UTC
Read the original article Hit count: 412

Filed under:
|
|

I need C# implementation ( ideally open source ) which is similar to Delphi DLL. I am currently using the wrapper ( C# syntax is provided , but it is a call from a different language )

zdiff( string ref str1, string ref str2, int range , int trim  ) 

it calls inside

str1 = GetHiDiff(@str1,1,trim)
str2 = GetHiDiff(@str1,2,trim)  

where

function GetHiDiff(s:pchar; sIndex:integer; wtrim:integer): pchar; stdcall;

What it does it returns a left fragment html of str1 and a right html fragment of str2 with diffs highlighted as strings are passed by reference. Range parameter determines the size of html fragment. Not sure what trim > 0 does.

© Stack Overflow or respective owner

Related posts about c#

Related posts about highlighting