CompareTextDiff
Mon 01 January 2018Syntax
CompareTextDiff(new_text, old_text [, content_type [, delimiter]])
Description
Use the CompareTextDiff function to compare the content of new_text with the content of old_text and return an array of array of any detailing the differences between the two strings. The elements of the returned subarray are as follows:
Element |
Data Type |
Description |
---|---|---|
index |
number |
The sequential index number in the comparison array. |
line |
number |
The line number for the line of text being compared. |
subline |
number |
The subline is the counter of added lines that exist in the new_text. Note: For DELETE, CHANGED and COMMON operations, 0 is always reported for the subline. |
type |
string |
The type of difference:
|
text |
string |
The actual text being compared. |
Parameters
Field or Control |
Definition |
---|---|
new_text |
Specifies the string that you want to compare with the old version of the string. |
old_text |
Specifies the old version of the string for comparison. |
content_type |
Specifies the content type as a literal: text or html. This parameter is optional. If content_type is html, HTML tags are stripped and are not included in the comparison. If content_type is not specified, it is set by default to text. |
delimiter |
An array of string specifying the delimiters to be used to split the content for comparison. This parameter is optional. If content_type is text and delimiter is not specified, the delimiter is set by default to char(13) (or \n, a carriage return). If content_type is html and delimiter is not specified, the delimiter array is populated by default with the following values:
|
Returns
An array of array of any.