Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# sort word

static char[] sortWord (string word)
{
    char[] result = word.ToCharArray ();
    char temp = '0';
    for (int i = 0; i < result.Length; i++)
    {
        // baa
        for(int j = 0; j < result.Length; j++)
        {
            if ((int)result[i] < (int)result[j])
            {
                temp = result[j];
                result[j] = result[i];
                result[i] = temp;
            }
            Console.WriteLine("I: " + result[i] + " J: " + result[j]);
        }
    }
    return result;
}
 
PREVIOUS NEXT
Tagged: #sort #word
ADD COMMENT
Topic
Name
6+6 =