VB6 -- Find all differences between two strings/files (FAST).
Just a module that I cooked up for doing string/file comparison. Pass it two strings, and it returns a comma delimited string of character positions that are unmatched in the other string. So, to get all changes (insertions and deletions) it would need to be called twice. For example, if given these two strings:
Original = "This is a test string."
Changed = "This was a test thing."
The output would be something like this:
6,16,18 in string 1 were deleted.
6,7,18 in string 2 were inserted.
To give you an idea of how fast this runs, given 1MB test strings with 20 random insertions and 20 random deletions, it averages about .3 seconds per comparison (uncompiled, and on my slow-a** work computer).
The zip file includes one .bas with the actual code "StringDiff.bas" and one with some test code to demo how to use it.