Create a custom sorting function in UIPath



Is there a way to create a custom sorting functions that compares two strings in UIPath ?

Thank you


It probably is, although I’m not really sure what you mean by ‘custom sorting function that compares strings’.
What’s the intended purpose?

Either way these should help:


That’s too complicated.
It’s easier to use the code activity or simply assign activity: bool res = string1 > string2


I would like to create a new comparator.
Say, I would like to teach UIPath that for instance “Obee” > “badita” and “badita” > “andrzej.kniola”, etc.


Then you need to create a custom implementation of IComparer<string> and import it.
See this as example.