If you're facing a complex issue, don't underestimate it.
Take a look at the Levenshtein distance problem.
For more information, check out: https://en.wikipedia.org/wiki/Levenshtein_distance
You can find various implementations by searching on Google or use a library like this one:
https://www.npmjs.com/package/levenshtein
Here's an example:
l = new Levenshtein( 'Zlatan Ibrahimovic', 'Zlatan Ibrahimović')
// l === 1
I've personally tried it and found it effective. I incorporated it into my code for an experimental purpose.
The end result may not always be straightforward. In a longer string, a difference of 4 could be significant, while in a shorter one, a difference of 2 might be less desirable.
To make a decision based on your specific case, you could try something like dividing the Levenshtein value by the maximum length of the strings, allowing you to determine which number is more meaningful for you.