Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created November 30, 2015 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/949d07dfb5df500d05cd to your computer and use it in GitHub Desktop.
Save Fhernd/949d07dfb5df500d05cd to your computer and use it in GitHub Desktop.
Comparación semántica de cadenas de caracteres.
using System;
namespace Articulos.Cap06
{
public class ComparacionSemantica
{
public static void Main()
{
Console.WriteLine ("¿Iguales {0} y {1}?: {2}", "EINSTEIN", "Einstein",
String.Equals("Einstein", "EINSTEIN", StringComparison.OrdinalIgnoreCase)); // True
Console.WriteLine ("\n¿Iguales {0} y {1}?: {2}", '\u1E7A'.ToString(), '\u01D5'.ToString(),
'\u1E7A'.ToString() == '\u01D5'.ToString());
Console.WriteLine ("\n¿Iguales {0} y {1}?: {2}", '\u1E7A'.ToString(), '\u01D5'.ToString(),
String.Equals('\u1E7A'.ToString(), '\u01D5'.ToString(), StringComparison.CurrentCulture));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment