给定两个字符串 text1
和 text2
:
public SOMEUSABLERETURNTYPE Compare(string text1, string text2)
{
// DO SOMETHING HERE TO COMPARE
}
示例:
第一个字符串:StackOverflow
第二个字符串:StaqOverflow
返回:相似度为91%
返回结果可以是%或类似的东西。
第一个字符串:The simple text test
第二个字符串:The complex text test
返回:这些值可以被认为是相等的
有什么想法吗?最好的方法是什么?