---
title: "onediff cookbook"
url: https://recursiveai.org/onediff/cookbook/
description: "6 OneDiff recipes, each with complete code."
version: "1.0.1"
---

# onediff cookbook

## Text and reports

- [Compare two strings word by word in C#](https://recursiveai.org/onediff/cookbook/compare-text/index.md): Compare two strings in C# at word level, render inline Markdown, inspect edit runs, and choose whether case changes count. Includes a runnable example.
- [Apply a unified diff patch in C#](https://recursiveai.org/onediff/cookbook/apply-unified-patch/index.md): Apply a unified diff patch to a C# string, check rejected hunks, and distinguish conflicts from success. Includes exact-context and reverse examples.
- [Create a side-by-side HTML diff in C#](https://recursiveai.org/onediff/cookbook/side-by-side-html-diff/index.md): Compare two text documents in C# and save a standalone side-by-side HTML report with OneDiff. Includes inline inputs, output, and an inline-layout variation.

## Compare and merge

- [Three-way text merge in C#](https://recursiveai.org/onediff/cookbook/three-way-text-merge/index.md): Merge a base and two edited text versions in C#, inspect conflicts, and apply an explicit resolution policy with a runnable .NET example.
- [Combine document reviewer changes in C#](https://recursiveai.org/onediff/cookbook/combine-reviewer-changes/index.md): Combine independent reviewer changes against one original in C#, preserve attribution, and flag conflicts with a runnable OneDiff example.
- [Compare PDFs and highlight differences in C#](https://recursiveai.org/onediff/cookbook/compare-pdf-highlight-changes/index.md): Compare text-bearing PDFs in C# and highlight differences on the new pages, with old text in pop-ups and a downloadable .NET example.
