0

I let the user search elements with a searchbar, elements are strings, if input text query has no match then the user can add a new element with the searched query text. The problem is that if the user misses the input by even one letter then he will add an item that actually already exists. Is there a prebuilt function which chosen a margin of error, finds strings similar to the user input that fall within this margin?

For example:

Elements = [try, code, stackoverflow]

user input "stakoveflow", margin error setted as 2

output -> stackoverflow

user input "stakoveflow", margin error setted as 1

output -> ""

shybaka
  • 160
  • 1
  • 7

0 Answers0