C# .NET - Arrange alphabetic letter - Asked By raj kumar on 15-May-13 12:11 PM

Arrange alphabetic letter
Input  - badeca
Output-aabcde

I want this Program
Sandeep Mittal replied to raj kumar on 16-May-13 02:55 AM
string word =  "badeca";
word = SortWord(word);
 
private string SortWord(string word)
{
  string[] arrStr = new string[word.Length];
  for (int i = 0; i < word.Length; i++)
  {       
    arrStr[i] = word[i].ToString();
  }
  Array.Sort(arrStr);     
  return string.Join(string.Empty, arrStr);
}
Danasegarane Arunachalam replied to Sandeep Mittal on 16-May-13 05:45 AM
Another method use LINQ : http://stackoverflow.com/questions/9963754/alphabetically-order-chars-in-linq