public static Item[] DiffText(string TextA, string TextB, bool trimSpace, bool ignoreSpace, bool ignoreCase)
{
// prepare the input-text and convert to comparable numbers.
Hashtable h = new Hashtable(TextA.Length + TextB.Length);
// The A-Version of the data (original data) to be compared.
DiffData DataA = new DiffData(DiffCodes(TextA, h, trimSpace, ignoreSpace, ignoreCase));
// The B-Version of the data (modified data) to be compared.
DiffData DataB = new DiffData(DiffCodes(TextB, h, trimSpace, ignoreSpace, ignoreCase));
h = null; // free up hashtable memory (maybe)
int MAX = DataA.Length + DataB.Length + 1;
/// vector for the (0,0) to (x,y) search
int[] DownVector = new int[2 * MAX + 2];
/// vector for the (u,v) to (N,M) search
int[] UpVector = new int[2 * MAX + 2];
LCS(DataA, 0, DataA.Length, DataB, 0, DataB.Length, DownVector, UpVector);
Optimize(DataA);
Optimize(DataB);
return CreateDiffs(DataA, DataB);
}