Article Details
Id:20478
Product:finPOWER Connect
Type:NEW
Version:4.00.03
Opened:22/11/2022
Closed:20/07/2023
Released:27/09/2023
Job: J030051

Business Layer; new function to compare strings added to ISTextUtilities

A new function to compute the difference between two strings has been added.

The function uses the Levenshtein Distance algorithm, also known as the Edit Distance. The number returned represents the number of single-character edits (inserts, deletes, or substitutions) required to convert the first string to the second string. For more information see https://en.wikipedia.org/wiki/Levenshtein_distance.

It can be useful for indexing and search applications as well as testing whether a User has changed the value of text. For example, has the User just corrected a spelling mistake or completely updated their address.

Sample code is shown below:

Distance = finBL.Runtime.TextUtilities.LevenshteinDistance("kitten", "written", True)