I'm studying string.Normalize()
method and I thought it is used to compare string equality if they are using different unicode.
Here's what I've done so far. Is the string.Equals()
is not what I'm supposed to use here?
string stra = "á";
string straNorm = stra.Normalize();
string strFormC = stra.Normalize(NormalizationForm.FormC);
string strFormD = stra.Normalize(NormalizationForm.FormD);
string strFormKC = stra.Normalize(NormalizationForm.FormKC);
string strFormKD = stra.Normalize(NormalizationForm.FormKD);
Console.WriteLine("norm {0}",straNorm);
Console.WriteLine("C {0}", strFormC);
Console.WriteLine("D {0}", strFormD);
Console.WriteLine("KC {0}", strFormKC);
Console.WriteLine("KD {0}", strFormKD);
Console.WriteLine("a".Equals(stra)); //false
Console.WriteLine("a".Equals(straNorm)); //false
Console.WriteLine("a".Equals(stra.Normalize())); //false
Console.WriteLine("a".Equals(strFormC)); //false
Console.WriteLine("a".Equals(strFormKC)); //false
Console.WriteLine("a".Equals(strFormKD)); //false