Below line of code give you the array valu in sort order.
Array .Sort(ProfiletagformValue );//output 0 Dotnet 1 Hr 2 SharePoint Array .Sort(profileTagArray);