TextDiffOptions Class
public sealed class TextDiffOptionsNo documentation is available.
Constructors
| Name | Description |
|---|---|
| TextDiffOptions() |
TextDiffOptions()
TextDiffOptions.cspublic TextDiffOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Algorithm | Gets or sets the algorithm used to compute the diff. TextDiffAlgorithm.Myers is the default and is recommended for general use. |
| Chunker | Gets or sets how the texts are split into the chunks that are compared against each other. Defaults to TextChunker.Lines. |
| IgnoreCase | 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. |
| IgnoreEndOfLine | 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. |
| IgnoreWhitespace | Gets or sets a value indicating whether the leading and trailing whitespace of a chunk is ignored when comparing chunks. |
Algorithm
TextDiffOptions.csGets 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
Chunker
TextDiffOptions.csGets 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
IgnoreCase
TextDiffOptions.csIgnoreEndOfLine
TextDiffOptions.csGets 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
Remarks
The normalization happens before chunking, so the entries of the result carry the normalized text rather than the original line terminators.
IgnoreWhitespace
TextDiffOptions.csGets 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
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.