Create a custom sorting function in UIPath


#1

Hello,

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

Thank you


#2

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:



#3

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


#4

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.
,


#5

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