dotnet add package Soenneker.Utils.String.LongestCommonSequence
LCS gives a straightforward measure of similarity. The longer the common subsequence, the more similar the sequences.
No bias for longer or shorter sequences. Focuses on shared elements, not sequence length.
Emphasizes the meaning of elements, not just their frequency. Great for identifying shared meaningful content.
Handles large datasets and extensive sequences efficiently. Practical for tasks involving substantial amounts of data.
var text1 = "This is a test";
var text2 = "This is another test";
double result = LcsStringUtil.CalculateSimilarityPercentage(text1, text2); // 70