如题

解决方案 »

  1.   

    char c = 你的字符
    if(c>128)
    {
        //全角
    }
    else
    {
        //半角
    }
      

  2.   

    可以看看他们在内存中的差别,以后也用的上;一般来讲同一字母全拼占内存地址比半拼多2位。下面是测试代码;
     static long GetSpaceForObject(object obj)
            {
                MemoryStream memory = new MemoryStream();
                BinaryFormatter bin = new BinaryFormatter();
                bin.Serialize(memory, obj);
                memory.Position = 0;
                return memory.Length;
            }
            static void Main(string[] args)
            {
               long c1 = GetSpaceForObject("A");
                long  c2 = GetSpaceForObject("A");
                Console.WriteLine(c1);
                Console.WriteLine(c2);
                Console.ReadLine();
            }