C#中字符数与字节数的区别
[ 2007-11-07 10:21:07 | 作者: admin ]
//取字符串长度
s = "iam中国人";
int len = s.Length;//will output as 6
byte[] sarr = System.Text.Encoding.Default.GetBytes(s);
len = sarr.Length;//will output as 3+3*2=9
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=1032
s = "iam中国人";
int len = s.Length;//will output as 6
byte[] sarr = System.Text.Encoding.Default.GetBytes(s);
len = sarr.Length;//will output as 3+3*2=9
[最后修改由 admin, 于 2007-11-07 10:22:03]

这篇日志没有评论。
此日志不可发表评论。