VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Compare 2 Strings

Josh Simmons  (3 Submissions)   String Manipulation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This VERY short function compares 2 strings and returns a number (that can be converted into percentage if multiplied by 100) that represents how closely related 2 strings are. For instance "ABCDE" and "ABCDF" would return say.... .8 (80%). Great for suggesting fixes for spelling errors et cetera. Feel free to use, abuse, and manipulate the code however you want, I'm sure it's not original, but I know it can be helpful :).

Inputs
CompareTXT(String1 as String, String2 as String) String1 and String2 are the only paramaters you need to send to the function, those are the two strings you wish to compare.

Returns
% value that represents exactly how similar two strings are.

Rate Compare 2 Strings (5(5 Vote))
Compare 2 Strings.bas

Compare 2 Strings Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters