How to get similar string

i have a list in which there is lots of players name
ex ;- if a name generated by user “steven smith”(textbox) but actually in list there is name “steve smith”
what i need is to get steve smith from the list or correct the word or anyways i just need to trigger that its actually steve smith not steven smith

help !!

Hi, I think this isn’t easy :thinking:

My only idea is:
Use Google to search for “Levenshtein distance”.

For example the Levenshtein distance between “steven smith” and “steve smith” is 1.

1 Like

Now That’s Another Something I Learnt Today.

Well I Say It Is.

what if there is one more name in list - steve jobs

then what it should auto correct to :thinking:

in that case there i think should be a list to choose from most similar matches

what you say.

1 Like

what about displaying a message “user name not found” and let the user try again?


Your methodology may be good to hear but don’t try to use @nishilbalyaya123 . Definitely you will end up with problem. If it is ms word we can look for auto correct but in app we should not. Else tour total work will become question… Even if one letter is mismatches follow the method suggested by @Taifun

YEA this i can do but i need actual correction bcz actually im not using textbox above i just gave example , actualy im getting player name from api, in api there is small mistake like steven etc.
if that posible detect steve smith from steven smith like in contain text block ( correction not required)

well, you should describe your problem correctly so we can think about solutions… else we find solutions, which fit for another problem…

you said “like steven etc”, what is etc in this case? you you know exactly, what needs to be replaced?
for example replace steve smith by steven smith, replace Eas Developer by Easy Developer … but do not replace steve jones…

you can setup a list of lists, each list item is a sublist, the first item the name you like to replace, the second item the replacement and use the loopup in pairs block to check the list of lists
How does the lookup in pairs block work?

alternatively use a dictionary…

it might be easier to fix the API …


i cannot make list becz there is lots of players name , it will be hard to make list and even i dont know whats the spell error in the word , as i said i got spell error of steve smith , like that there is other players (not all) whose spells are mistaken.

unfortunately there is no magical “fix all spellings in names” method available
what about making sure, that there are no spelling errors inside that API… if someone entered his/her name wrong during registration, then it also stays wrong… same here in this community and everywhere else…


the api is getting wrong spelling sometime, no problem im going to lookup in pairs that what u gave solution

thanks @Taifun