string s =@"­";
string r = HttpUtility.HtmlDecode(s);
string r3 = string.Format("1{0}Jan{0}2007",r);
Console.WriteLine(r3);
if(r3 == "1-Jan-2007")
{
Console.WriteLine("Equal");
Console.WriteLine("1-Jan-2007");
}
else
{
Console.WriteLine("Not Equal");
Console.WriteLine("1-Jan-2007");
}
出力は
2007 年 1 月 1 日 等しくない 2007 年 1 月 1 日
しかし、r を "-" に置き換えると、string.Format("1{0}Jan{0}2007","-"); 出力は
2007 年 1 月 1 日 2007 年 1 月 1 日と等しい