Compare strings and highlight differencesHow would I write a function or routine that would compare two strings and show the difference between them?
e.g.
string1="It will rain tomorrow"
string2="It will snow tomorrow"
comparison result (string2 vs string 1) = "It will rainsnow tomorrow"
ScriptingRe: Compare strings and highlight differencesWhat are the rules?
Is
It will rain tomorrow
different from
Tomorrow it will rain
If you are just comparing each word from one string to the same position word in a second string, that can easily be done by looping through the strings using the Word() function to compare each word.
But going beyond that, the algorithm can become very complexRe: Compare strings and highlight differencesWhat I want is something akin to what MS Word will do when it compares documents.
The actual thing I want to do is when comparing two data tables, particularly differences in tables scripts and column formulas.
Compare Data Tables will show, for instance, if saved table scripts are different and list them both out, which I can save to a table with the strings in the table in separated columns, but what I want to see is where those two scripts are different.
Re: Compare strings and highlight differencesSeems like this could be done with regular expressions, I just don't know how.
Re: Compare strings and highlight differencesCompare two files
Re: Compare strings and highlight differencesShortest Edit Script gets me the information that I need, that is very helpful, thanks!