Created
November 30, 2015 21:21
-
-
Save Fhernd/949d07dfb5df500d05cd to your computer and use it in GitHub Desktop.
Comparación semántica de cadenas de caracteres.
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 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