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

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -