VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

A Smart String Comparison

Atul Brad Buono  (3 Submissions)   String Manipulation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

This takes 2 strings and returns the percent alike that they are. (i.e. "test string number 1" is 86.48% similar to "teststring numb 2")
This function is very useful! You can use it in databases to match data that may have errors in it. Examples being people's names, company names, addresses, or anything else where you may encounter misspellings or inconsistencies in the data. Your feedback and/or votes are greatly appreciated! -- NEW - updated to use byte arrays instead of strings, 50-300% performance improvement!
An implementation of the , Ratcliff/Obershelp/Levenshtein method.

Inputs
mainstring and checkstring, the 2 strings to compare

Assumes
This code recursively loops through the 2 strings, finding the largest common substring, then checking the remainder of the string.

Returns
how similar the 2 strings are (percent, as in .8)

Rate A Smart String Comparison (35(35 Vote))
A Smart String Comparison.bas

A Smart String Comparison Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters