Get similarity score (from 0 to 100) of two strings

string:similarity_percent(STRING $string1, STRING $string2) : INT

string:similarity_percent('hi','bye')
#=> 0

string:similarity_percent('hi','byi')
#=> 40    

string:similarity_percent('good morning','good bye')
#=> 50

string:similarity_percent('good bye','good morning')
#=> 50

string:similarity_percent('a','a')
#=> 100

string:similarity_percent('a','A')
#=> 0

string:similarity_percent('A','')
#=> 0

string:similarity_percent('','')
#=> 0

Copyright ©2013-2022 SunSed®. All rights reserved.