java - Difference between Strings -


is there method compare 2 string values .compareto returns number of letters aren't same?

example:

"somestring".anothercompareto("somestrng") -> 1 "somestring".anothercompareto("smestrng") -> 2 "somestring".anothercompareto("somestrong") -> 1 

i can't find anything. tried convert chararrays , write method myself failed. if not possible, maybe there's method compares 2 strings same length returns number of "mistakes"?

apache commons has method diff strings

stringutils.difference(string str1, string str2)

that can use create method returns number of differences easily.

edit:

infact exists:

stringutils.getlevenshteindistance(string str1, string str2)


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -