Diff : Algorithm.Diff Namespace
TextDiff

Provides a differencing algorithm that is specialized for text documents.

public class TextDiff : IDiff


Remarks

The TextDiff class provides a structured diff for text documents. It performs line-by-line, word-by-word, and character-by-character comparisons between a base document and a changed document.

TextDiff provides cleaner differences than a normal character-by-character diff because it is aware of correspondences of words and lines between the two documents. It will recognize words and lines as being unchanged in cases where a normal character diff may generate fewer hunks, though those hunks less accurately reflect the kind of changes a human would make to a document.

Members

See Also: Inherited members from object.

Constructors
Constructs a case-sensitive diff between the two documents.
Compares two documents using a comparer object to perform string comparisons.
Properties
Left [read-only]
IList . The left document.
Right [read-only]
IList . The right document.
Member Details
TextDiff Constructor
public TextDiff (string left, string right)

Constructs a case-sensitive diff between the two documents.

Parameters
left
The left document.
right
The right document.
Remarks
None.

TextDiff Constructor
public TextDiff (string left, string right, IComparer comparer)

Compares two documents using a comparer object to perform string comparisons.

Parameters
left
The left document.
right
The right document.
comparer
A comparer object to compare substrings of the documents, or null to use the default string comparer.
Remarks
None.

Left
public IList Left { get; }

The left document.

Value
The left document.
Remarks
None.

Right
public IList Right { get; }

The right document.

Value
The right document.
Remarks
None.