1、正则表达式方法:
System.Text.RegularExpressions.Regex.Replace(str, "[^\x00-\xff]", "**").Length
2、Encoding方法:
Encoding.Default.GetByteCount(str)
1、正则表达式方法:
System.Text.RegularExpressions.Regex.Replace(str, "[^\x00-\xff]", "**").Length
2、Encoding方法:
Encoding.Default.GetByteCount(str)
转载于:https://www.cnblogs.com/Kylin98/archive/2013/01/03/2842899.html