VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



'this tracks differences between two similar strings 'for example I AM LIVING IN ATHENS.GREETINGS

by Alexander Triantafyllou (5 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 4th July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

'this tracks differences between two similar strings 'for example "I AM LIVING IN ATHENS.GREETINGS" and ' "I AM LIVING IN LONDON.GREETINGS"

Rate 'this tracks differences between two similar strings 'for example I AM LIVING IN ATHENS.GREETINGS



'this tracks differences between two similar strings
'for example "I AM LIVING IN ATHENS.GREETINGS" and
' "I AM LIVING IN LONDON.GREETINGS" will
'return "LONDON"
'made by Alexander Triantafyllou [email protected]
'feel free to use it where you want
'
'
'if you like it vote for it
'Greetings from Athens - Greece

pastedstr = ""

spos = 1
fpos = 1
Do While spos < Len(input1)
floko = Mid(input1, spos, 1)
fluki = Mid(input2, fpos, 1)
If floko = fluki Then
spos = spos + 1
fpos = fpos + 1
Else
Exit Do
End If
Loop

epos = Len(input1)
flupos = Len(input2)

Do While epos > spos
floko = Mid(input1, epos, 1)
fluki = Mid(input2, flupos, 1)
If fluki = floko Then
epos = epos - 1
flupos = flupos - 1
Else
Exit Do
End If
Loop

If flupos = 0 Then
trackchanges = input1
Else
trackchanges = Mid(input2, spos, flupos - spos + 1)
End If

End Function

Download this snippet    Add to My Saved Code

'this tracks differences between two similar strings 'for example I AM LIVING IN ATHENS.GREETINGS Comments

No comments have been posted about 'this tracks differences between two similar strings 'for example I AM LIVING IN ATHENS.GREETINGS. Why not be the first to post a comment about 'this tracks differences between two similar strings 'for example I AM LIVING IN ATHENS.GREETINGS.

Post your comment

Subject:
Message:
0/1000 characters