UiPath Studio compare strings using Levenshtein Distance Algorithm | VB.net code in description

UiPath Studio compare strings using Levenshtein Distance Algorithm | VB.net code in the description

Code:

0:00 Intro
0:10 The purpose of the movie
0:55 Simple compare between string
2:25 Compare without UpperCase and LowerCase limit
3:50 Examples with misspelled
5:00 Details of parameters that you need to configure
6:35 Change percent inside of algorithm
9:15 Conclusions
9:35 Subscribe to my channel

1 Like

Hi

Thank you,
I have used below code and this is working fine for me.

Dim count As Integer = If(str1.Length > str2.Length, str1.Length, str2.Length)
Dim hits As Integer = 0
Dim i, j As Integer : i = 0 : j = 0
For i = 0 To str1.Length - 1
If str1.Chars(i) = " " Then i += 1 : j = str2.IndexOf(" "c, j) + 1 : hits += 1
While j < str2.Length AndAlso str2.Chars(j) <> " "c
If str1.Chars(i) = str2.Chars(j) Then
hits += 1
j += 1
Exit While
Else
j += 1
End If
End While
If Not (j < str2.Length AndAlso str2.Chars(j) <> " "c) Then
j -= 1
End If
Next
perc= (Math.Round((hits / count), 5)*100).ToString