摘要:
C# .NET类库自带的str.Replace() 方法替换文本不能区分大小写。我们可以自己编写一个扩展方法,支持文本忽略大小写替换。以下扩展方法实现了使用正则表达式忽略大小写替换文本。 public static string ReplaceText(this string text, strin 阅读全文
2022年2月16日 #
摘要:
C# 采用动态规划算法,计算两个字符串之间的相似程度。 public static double CountTextSimilarity(string textX, string textY, bool isCase = false) // 计算文本相似度 { if (textX.Length ⇐ 阅读全文