Thursday, July 3, 2014

VBScript - find difference between similar strings

' Presume input strings named s1 and s2
' Assume Len(s1) = Len(s2)
Dim i

For i = 1 to Len(s1)
   If Asc(Mid(s1, i, 1)) <> Asc(Mid(s2, i, 1)) Then
        Msgbox "Strings differ at character " & i
    End If
Next 'i

No comments:

Post a Comment