-
-
Save parzibyte/391751f0ec3f4b96a61198633bc23abc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace App | |
{ | |
class Programa | |
{ | |
/* | |
https://parzibyte.me/blog | |
*/ | |
static void Main(string[] args) | |
{ | |
string cadena1 = "Aloy"; | |
string cadena2 = "Zelda"; | |
Console.WriteLine("Resultado de comparar '{0}' con '{1}'", cadena1, cadena2); | |
int resultado = cadena1.CompareTo(cadena2); | |
if (resultado == 0) | |
{ | |
Console.WriteLine("Las cadenas son iguales"); | |
} | |
else if (resultado < 0) | |
{ | |
Console.WriteLine("{0} es lexicográficamente menor que {1}", cadena1, cadena2); | |
} | |
else | |
{ | |
Console.WriteLine("{0} es lexicográficamente mayor que {1}", cadena1, cadena2); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment