DiffUtils
概述
DiffUtils 是 Aspose.PDF FOSS 中用于 .NET 的一个类。
差异引擎使用的文本辅助工具:从 DiffOperations 列表中提取公共前缀/后缀并重新组装源/目标文本。
此类提供 6 种方法,用于在 .NET 程序中处理 DiffUtils 对象。可用的方法包括:AssemblyDestinationText、AssemblySourceText、FindCommonEndParts、FindCommonStartParts。在安装 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。
方法
| 签名 | 描述 |
|---|---|
FindCommonStartParts(first: string?, second: string?) | 第一个和第二个共享的最长公共前缀(如果它们在第一个字符就不同,则为空)。 |
FindCommonStartParts(first: StringBuilder?, second: StringBuilder?) | StringBuilder 是 FindCommonStartParts(string,string) 的重载。 |
FindCommonEndParts(first: string?, second: string?, startIndex: int) | 第一个和第二个共享的最长公共后缀,且不向前匹配超过第一个中的索引 startIndex(因此结果长度受 first.Length - startIndex 限制)。 |
FindCommonEndParts(first: StringBuilder?, second: StringBuilder?) | StringBuilder 是 FindCommonEndParts(string,string,int) 的重载,且没有下界(startIndex = 0)。 |
AssemblySourceText(diffs: IEnumerable<DiffOperation>?) | 重建原始(源)文本:所有 Equal 和 Delete 运行的串联。 |
AssemblyDestinationText(diffs: IEnumerable<DiffOperation>?) | 重建修改后(目标)文本:所有 Equal 和 Insert 运行的串联。 |