158
Views
3
Comments
Solved
Compare 2 strings

Hello

I want to compare 2 string by their alphabetic order

For example 

Ana is first than Bernardo 

 Ana is first than Anabela

Does anyone know if exists any function to do that?

i have done a lot of researche and didn't find anything

thanks 





2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi,

Although the solution as provided in previous replies works, it is overcomplicated, there is a way easier and faster way to do this just compare the two text variables using <

Text1 < Text2  

Ana < Bernardo  = True

 Ana < Anabela = True

Anabela < Bernardo = True

Bernardo < Ana = False

I suggest to use only the solution with a list and sort it if you have more than 2 values to compare.

Regards,

Daniel

2025-10-10 00-19-44
Bruno Rendeiro

Hi

https://www.outsystems.com/forge/component-overview/22/sortrecordlist

Do this help you?

Add your string to a list, then sort the list 

2024-10-16 11-59-48
Nick Vandebriel

Hello Joana


Not 100 % sure if this is what you need but you could add your strings to a text list and sort it with the listsort

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi,

Although the solution as provided in previous replies works, it is overcomplicated, there is a way easier and faster way to do this just compare the two text variables using <

Text1 < Text2  

Ana < Bernardo  = True

 Ana < Anabela = True

Anabela < Bernardo = True

Bernardo < Ana = False

I suggest to use only the solution with a list and sort it if you have more than 2 values to compare.

Regards,

Daniel

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.