惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - 袁礼定

推荐网站: guship.cn 推荐网站: 开发测试教程 devqa.cn C#参考教程 http://www.csref.cn 最全的运营推广方案,教你如何从零开始运营APP SEO: Response.Redirect() 摘抄: Windows XP登录口令丢失的应急办法 随想 .net中统计时间的方法 zhaichao: 蔡文胜:站长之王 Sub String in Dos command Merge file using dos command Trip to America for 3 more months 明天的飞机,到美国培训和出差三个月,记一笔 javascript 游戏开发 乡村与城市的差别不是18年! 摘抄:透明PNG在IE6下的官方解决方案 本人从事软件技术开发也有多年,打算先尝试往外迈一步试试! 在办公室里面不能访问部分.cn域名的网站,但不在办公室里面就能访问 Get Sender Email Address from Outlook using CDO in C#
汉字转拼音缩写的函数(C#)
袁礼定 · 2007-06-14 · via 博客园 - 袁礼定

        /// <summary>
        ///
汉字转拼音缩写
        /// Code By
MuseStudio@hotmail.com
        /// 2004-11-30
        /// </summary>
        /// <param name="str">
要转换的汉字字符串</param>
        /// <returns>
拼音缩写</returns>
        public string GetPYString(string str)
        {
            string tempStr = "";
            foreach(char c in str)
            {
                if((int)c >= 33 && (int)c <=126)
                {//
字母和符号原样保留
                    tempStr += c.ToString();
                }
                else
                {//
累加拼音声母
                    tempStr += GetPYChar(c.ToString());
                }
            }
            return tempStr;
        }

        /// <summary>
        ///
取单个字符的拼音声母
        /// Code By
MuseStudio@hotmail.com
        /// 2004-11-30
        /// </summary>
        /// <param name="c">
要转换的单个汉字</param>
        /// <returns>
拼音声母</returns>
        public string GetPYChar(string c)
        {
            byte[] array = new byte[2];
            array = System.Text.Encoding.Default.GetBytes(c);
            int i = (short)(array[0] - '\0') * 256 + ((short)(array[1] - '\0'));

            if ( i < 0xB0A1) return "*";
            if ( i < 0xB0C5) return "a";
            if ( i < 0xB2C1) return "b";
            if ( i < 0xB4EE) return "c";
            if ( i < 0xB6EA) return "d";
            if ( i < 0xB7A2) return "e";
            if ( i < 0xB8C1) return "f";
            if ( i < 0xB9FE) return "g";
            if ( i < 0xBBF7) return "h";
            if ( i < 0xBFA6) return "g";
            if ( i < 0xC0AC) return "k";
            if ( i < 0xC2E8) return "l";
            if ( i < 0xC4C3) return "m";
            if ( i < 0xC5B6) return "n";
            if ( i < 0xC5BE) return "o";
            if ( i < 0xC6DA) return "p";
            if ( i < 0xC8BB) return "q";
            if ( i < 0xC8F6) return "r";
            if ( i < 0xCBFA) return "s";
            if ( i < 0xCDDA) return "t";
            if ( i < 0xCEF4) return "w";
            if ( i < 0xD1B9) return "x";
            if ( i < 0xD4D1) return "y";
            if ( i < 0xD7FA) return "z";

            return "*";
        }