1. Docs
  2. Formulas
  3. Functions

LEVENSHTEIN_DISTANCE

Compute the Levenshtein distance between two strings.

Categories: Text

Syntax

LEVENSHTEIN_DISTANCE(string_one, string_two, [insertion_cost: 2], [deletion_cost: 2], [substitution_cost: 1])

Examples

Example 1

Input

1
{
2
"my_action": {
3
"name_one": "Smith",
4
"name_two": "Simth"
5
}
6
}

Formula

LEVENSHTEIN_DISTANCE(my_action.name_one, my_action.name_two)

Output

2

Example 2

Input

1
{
2
"my_action": {
3
"name_one": "kitten",
4
"name_two": "sitting"
5
}
6
}

Formula

LEVENSHTEIN_DISTANCE(my_action.name_one, my_action.name_two, insertion_cost: 1, deletion_cost: 1)

Output

3

Sample actions

Event Transform
My Action
Event Transform
LEVENSHTEIN_DISTANCE
Event Transform
My Action

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?