Difference between two string.
I want to compare two string, and want to see differeince in int form. For example,
Code:
string first_string="0002AE1";
string second_string="0002AE2";
How can i calculate difference between two string? It is obvious difference between above two string is 1/-1, but difference would be 1.
Re: Difference between two string.
It depends on what metric you wish to use. You could start by reading up on say, "edit distance".
Re: Difference between two string.
What do you mean by 'diference between two strings'? What are you trying to accomplish? One simple possibility would be to iterate through each character of the two strings and add the absolute difference between the ASCII values of each character.