//posted By Suresh
//Input = StrA!%StrC!%StrB!%StrD!%StrE";
//Output = StrE!%StrD!%StrC!%StrB!%StrA";
string InStr = "StrA!%StrC!%StrB!%StrD!%StrE";
string outStr = "";
string[] del = new string[] {"!%"};
string[] TempArr = InStr.Split(del, StringSplitOptions.None);
Array.Sort(TempArr);
Array.Reverse(TempArr);
outStr = string.Join(("!%",TempArr);
No comments:
Post a Comment