转 .net里如何判断中文字符长度

C#

protected int GetLength(string strValue)
    {
        byte[] myByte = System.Text.Encoding.Default.GetBytes(strValue);
        return myByte.Length;
    }

posted on 2008-11-27 12:36 小小小程序员 阅读(302) 评论(0) 编辑 收藏