I have a problem statement given below;
inputArray = {"rajesh|51|32|asd", "nitin|71|27|asd", "test|11|30|asd"}
It is a input array and I need to sort this Sting Array[] in ascending order based on the number next to Name in each string, So the returned output Array should like like this;
output = {"test|11|30|asd", "rajesh|51|32|asd" ,"nitin|71|27|asd"}
I tried below code but I am not able to write the complete code as I am stuck at some point, What should I use to get the desired sorted output Array?
int sort = 0;
foreach(string s in inputArray)
{
string[] foo = s.split("|");
int orderNum = Convert.ToInt32(foo[1])
if(sort<orderNum)
sort = orderNum;
//stuck here..
}