You will need to clearly define the “difference amount”. There is plenty of room for maneuver.
For example, the old C / C ++ strcmp() compares character by character and returns the difference the first time they do not match.
On the other hand, diff provides a complete list of the differences between two files (which in a sense are also strings). How would you rate this?
source share