Why my code just compare first character? Where's my error? I'am trying to compare the characters from two strings and get the string which comes first like "camera" comes first than "car". but if "camera" was the second parameter, my program tells me, car comes first.
static string CompareChars(string a, string b)
{
foreach (char aa in a)
{
foreach (char bb in b)
{
if (aa > bb)
return a;
}
}
return b;
}