SPDiffUtility.Diff Method
Determines the text differences between two strings.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function Diff ( _
str1 As String, _
str2 As String, _
maxDifferences As Integer _
) As String
'Usage
Dim str1 As String
Dim str2 As String
Dim maxDifferences As Integer
Dim returnValue As String
returnValue = SPDiffUtility.Diff(str1, str2, _
maxDifferences)
public static string Diff(
string str1,
string str2,
int maxDifferences
)
Parameters
str1
Type: System.StringThe original string.
str2
Type: System.StringThe changed string.
maxDifferences
Type: System.Int32A 32-bit integer representing the maximum number of differences to find.
Return Value
Type: System.String
A merged version of the specified strings that contain HTML tags indicating inserted, deleted, or changed text.