TinyMUX

Strdistance()

Functions

Description

FUNCTION: strdistance(<string1>, <string2>)

Returns the Levenshtein edit distance between two strings. The edit distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to transform one string into the other.

Comparison is performed at the Unicode codepoint level.

Examples

> say strdistance(kitten, sitting)

You say, “3”

> say strdistance(hello, hello)

You say, “0”

comp(), match(), strmatch()