Probably i need to use this function to compare 2 strings.
Public Class Distance
Public Function LD(s As String, t As String) As Integer
Dim n As Integer = s.Length
Dim m As Integer = t.Length
Dim d As Integer(,) = New Integer(n, m) {}
Dim cost As Integer
If n = 0 Then
Return m
End If
If m = 0 Then
Return n
End If
Dim i As Integer = 0
While i <= n
d(i, 0) = System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
End While
Dim j As Integer = 0
While j <= m
d(0, j) = System.Math.Max(System.Threading.Interlocked.Increment(j), j - 1)
End While
For h As Integer = 1 To n
For f As Integer = 1 To m
cost = (If(t.Substring(f - 1, 1) = s.Substring(h - 1, 1), 0, 1))
d(h, f) = System.Math.Min(System.Math.Min(d(h - 1, f) + 1, d(h, f - 1) + 1), d(h - 1, f - 1) + cost)
Next
Next
Return d(n, m)
End Function
End Class