use*_*781 0 java string compare
我希望找到以相互比较字符串的方式,它理解在以下示例中s1和s2之间没有区别.
String s1 = "John: would you please one the door";
String s2 = "John: would you please one the door ????";
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
使用String度量来描述字符串之间的相似性概念.字符串度量的基本示例是Levenshtein距离(通常称为编辑距离).
Wikibooks提供了该算法的Java实现:http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Java
| 归档时间: |
|
| 查看次数: |
86 次 |
| 最近记录: |