主页 > 编程资料 > C# >
发布时间:2015-09-26 作者:网络 阅读:191次
using System;
using System.Text;

namespace PubClass.CSharp.String
{
    public class UTP8String
    {
        public long Length(string strLen)
        {
            bool winnt_chinese=true;
            winnt_chinese=("中国".Length ==2,',',');
            if(winnt_chinese)
            {
                long l,t,c;
                int i;
                l=strLen.Length ;
                t=l;
                for( i=0;i                {
                    c=(int)strLen[i];
                    if( c<0)
                    {
                        c=c+65536;
                    }
                    if (c>255)
                    {
                        t=t+1;
                    }
                }
                return t;
            }
            else
            {
                return strLen.Length ;
            }
        }
    }
}    
关键字词: