返回字符串长度(汉字长度为2)

         private int GetLength(String aOrgStr)
        {
            int intLen = aOrgStr.Length;

            int i;

            char[] chars = aOrgStr.ToCharArray();
            for (i = 0; i < chars.Length; i++)
            {
                if (System.Convert.ToInt32(chars[i]) > 255)
                {
                    intLen++;
                }
            }
            return
            intLen;
        }

posted @ 2007-11-07 11:38  磊.NET  阅读(414)  评论(1编辑  收藏  举报