Advertisement

Produce a diff representing the changes between two text strings

Syntax

DiffCompare(pFrom,pTo [,pContext])

Parameters

  • pFrom: The original source string. The produced diff will describe how to transform this string.
  • pTo: The updated source string. This will be compared to pFrom to produce the output diff.
  • pContext: optional. The number of unchanged lines to include before / after each change in the diff.

Example

put diffCompare("Hello world", "Hello")

it returns:

@@ -1 +1 @@
-Hello world
\ No newline at end of file
+Hello
\ No newline at end of file

Compare two strings, producing a string representing the changes between them in unified-diff format.

See also: DiffCompareFiles, DiffPatch

Community content is available under CC-BY-SA unless otherwise noted.