Hi Community,
I have an array which contains below elements in string format. I want to sort it based on the first 3 characters which are numbers. I tried Invoke method activity and Linq query but using them it’s sorting based on alphabet not number.
Input can be either array or a list as I am splitting it from a string using delimitter “;”.
Input: {002-UiPath;000-Bot;001-Automation}
Output (Using Sort, Invoke Method Activity (Sort), Linq) : {001-Automation;000-Bot;002-UiPath}
Give a try to this
{“002-UiPath”,“000-Bot”,“001-Automation”}.OrderBy(Function(x) System.Text.RegularExpressions.Regex.Match(x,“[0-9]{3}”).Value).ToArray()