全角半角字符串长度获取方法
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)