Skip to content
ConsoleMonster
Class

TextDiff

ConsoleMonster.Changes

Namespace
ConsoleMonster.Changes
Assembly
ConsoleMonster
Modifiers
static

Dependency-free text comparison shared by object previews, text widgets and unified output.

Inheritance

  • object
  • TextDiff

Methods

public static TextDiffResult Compare(string? referenceText, string? differenceText, TextDiffOptions? options = null) #

Compares lines ordinally using linear auxiliary memory and a bounded comparison budget. For very different large ranges the result remains exact as an edit script, but may contain more edits than a minimal diff. CRLF, LF and CR endings are equivalent; the presence of the final newline is significant.

Parameters

referenceText string? required
The original text; null is empty.
differenceText string? required
The new text; null is empty.
options ConsoleMonster.Changes.TextDiffOptions? = null optional
Comparison and presentation settings, copied into the result.

Returns

TextDiffResult A reusable comparison, with original text and line numbers.