http://www.cnblogs.com/chenxizhang/archive/2009/06/07/1498312.htmlCode
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string input = "你好,我是陈希章";
byte[] bytes = Encoding.Default.GetBytes(input);
Console.WriteLine(bytes.Length);//返回15,每个汉字占两个字节(7×2=14),标准的占1个字节
byte[] bytes2 = Encoding.Unicode.GetBytes(input);
Console.WriteLine(bytes2.Length);//返回16,所有字符都用两个字节
byte[] bytes3 = Encoding.ASCII.GetBytes(input);
Console.WriteLine(bytes3.Length);//返回8,所有字符都用一个字节(有点诡异)
Console.Read();
}
}
}
也就是说,一个字符串具体占多大空间,还取决于字符的编码