Q:

How much two strings are similar?(90%,100%,40%)

I have an input string and a collection of strings and I want to compare the input string and find the best choices to view. I want to write a function that tell me how much this two string are similar.have you any idea? 

A:

For 'short' string differences the algorithm you are searching for is called:
Levenshtein distance
http://en.wikipedia.org/wiki/Levenshtein_distance
For seeking differences in sentences you may wish to check for algorithms that solve the 'longest common sequence' problem. 
One tool that does that is the (originally unix) 'diff'

