static void Main(string[] args)
{
var a1= Encoding.UTF8.GetBytes("<");
var a2 = Encoding.UTF8.GetBytes("<");
Console.WriteLine("去除utf-8 bom之前");
Console.WriteLine(Encoding.UTF8.GetString(a1));
Console.WriteLine(Encoding.UTF8.GetString(a2));
if (a2.Length >= 3&& a2[0] == 239 && a2[1] == 187 && a2[2] == 191)
{
var a2Tmp = a2.ToList();
a2Tmp.RemoveRange(0, 3);
a2 = a2Tmp.ToArray();
}
Console.WriteLine("去除utf-8 bom之后");
Console.WriteLine(Encoding.UTF8.GetString(a1));
Console.WriteLine(Encoding.UTF8.GetString(a2));
}