How do i sort an array of stiring by lenght?

So i have an array of string that looks something like that: {“blue”,“red”,“green”}.
How can i sort it by the lenght of the strings?

1 Like

Welcome back to uipath community
Hope this would help you
List (of string) out_list = samplearray.OrderBy(Function(s) s.Length).ToList()

Where samplearray is our array variable

Cheers @velizar

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.