Get closest matched strings

Hello

lets say i have 2 lists

list a [bedroom , livingroom , KITCHED]

list b [ kitchen, bed room , living]

so how can i sort them to have same order by closest text

Hi maybe List.Sort could work in that case

ty but in my case i have 3 rooms name in a list (from excel)

and on the other list i have 20+ rooms name (all rooms in project)

so in my casei think sort wont work

its like, i want the index of the closest text from list 2

allright then try string remove with start index 3 and a string length - 3 as count, and use a string to lower in your first list and use List.AllIndicesOf for get sort index…maybe if i understand :wink:
PS btw why not just spell it right ?
here is a fast example with the princip with these 2 list you showed

AI should be able to smash some python out if you ask for this algorithm to be used. Force it all to lower case if case invariant first, as well as trim left/right to get rid of whitespace either end.

I think a package out there might have a node for this, I’ll look into it for my own potentially…

Google AI py example:

Edit: Here’s a C# Proof of concept: