转 .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  小小小程序员  阅读(1898)  评论(0编辑  收藏  举报

导航