TextDiffOptions Class

public sealed class TextDiffOptions

No documentation is available.

Constructors

NameDescription
TextDiffOptions()

TextDiffOptions()

TextDiffOptions.cs
public TextDiffOptions()

No documentation is available.

Properties

NameDescription
AlgorithmGets or sets the algorithm used to compute the diff. TextDiffAlgorithm.Myers is the default and is recommended for general use.
ChunkerGets or sets how the texts are split into the chunks that are compared against each other. Defaults to TextChunker.Lines.
IgnoreCaseGets or sets a value indicating whether two chunks that differ only in casing are considered equal. The comparison is ordinal, so casing rules are not culture-sensitive.
IgnoreEndOfLineGets or sets a value indicating whether line terminators are normalized to "\n" before the texts are chunked, so that "\r\n", "\r" and "\n" compare equal.
IgnoreWhitespaceGets or sets a value indicating whether the leading and trailing whitespace of a chunk is ignored when comparing chunks.

Gets or sets the algorithm used to compute the diff. TextDiffAlgorithm.Myers is the default and is recommended for general use.

public TextDiffAlgorithm Algorithm { get; set; }

Property value

TextDiffAlgorithm

Gets or sets how the texts are split into the chunks that are compared against each other. Defaults to TextChunker.Lines.

public TextChunker Chunker { get; set; }

Property value

TextChunker

Gets or sets a value indicating whether two chunks that differ only in casing are considered equal. The comparison is ordinal, so casing rules are not culture-sensitive.

public bool IgnoreCase { get; set; }

Property value

bool

IgnoreEndOfLine

TextDiffOptions.cs

Gets or sets a value indicating whether line terminators are normalized to "\n" before the texts are chunked, so that "\r\n", "\r" and "\n" compare equal.

public bool IgnoreEndOfLine { get; set; }

Property value

bool

Remarks

The normalization happens before chunking, so the entries of the result carry the normalized text rather than the original line terminators.

IgnoreWhitespace

TextDiffOptions.cs

Gets or sets a value indicating whether the leading and trailing whitespace of a chunk is ignored when comparing chunks.

public bool IgnoreWhitespace { get; set; }

Property value

bool

Remarks

Only the edges of a chunk are trimmed; whitespace inside a chunk remains significant. With the default TextChunker.Lines chunker, "a b" and "a b" are still different. Use TextChunker.Words to make internal whitespace insignificant: it puts each run of whitespace in its own chunk, which trimming then reduces to an empty one.