取汉子拼音首字母的C#方法】的更多相关文章

/// <summary> /// 获得一个字符串的汉语拼音码 /// </summary> /// <param name="strText">字符串</param> /// <returns>汉语拼音码,该字符串只包含大写的英文字母</returns> public static string GetChineseSpell(string strText) { if (strText == null || st…
'/ <summary> '/ 获得一个字符串的汉语拼音码 '/ </summary> '/ <param name="strText">字符串</param> '/ <returns>汉语拼音码,该字符串只包含大写的英文字母</returns> Public Shared Function GetChineseSpell(ByVal strText As String) As String If strText…
转载http://blog.fwhyy.com/2012/03/take-the-first-initials-method-of-csharp-and-vbnet/…
//取字符串拼音首字母 function makePy(str) { if (typeof(str) != "string") throw new Error(-1, "函数makePy需要字符串类型参数!"); var arrResult = new Array(); //保存中间结果的数组 for (var i = 0, len = str.length; i < len; i++) { //获得unicode码 var ch = str.charAt(i…
sqlserver 使用函数获取一个字符串的拼音首字母 create function dbo.fn_getpinyin ( @str nvarchar(max) ) returns nvarchar(max) as begin ),@PY nvarchar(max) set @PY='' begin ) --如果非汉字字符,返回原字符 PY from ( select 'A' as PY,N'驁' as word union all select 'B',N'簿' union all sele…
)='') ) as begin ), ) , ,) if @chn > 'z' if( @chn < '八' ) set @c = 'A' else if ( @chn < '嚓' ) set @c = 'B' else if ( @chn < '咑' ) set @c = 'C' else if ( @chn < '妸' ) set @c = 'D' else if ( @chn < '发' ) set @c = 'E' else if ( @chn < '旮…
现实中我们经常看到这样的说明,排名不分先后,按姓名首字母进行排序.这是中国人大多数使用的排序方法.那么在php程序中该如何操作呢? 下面就分享一下在php程序中获取汉字拼音的首字母的方法,在网上搜到的大多数是有问题的,这个可是经过小编实践应用过的,真的可以使用的哦. //php获取中文字符拼音首字母 function getFirstCharter($str){  if(empty($str)){return '';}  $fchar=ord($str{0});  if($fchar>=ord(…
今天突然要用到提取汉字拼音首字母的功能,去网上找了找,发现没有几个好用的,决定自己写一个,效果还不错,发出来大家一起研究下,分享给大家!直接入主题: 1.首先对编码进行定义 #region 编码定义 private static int[] pyvalue = new int[]         {         -20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20…
1.获得一个字符串的每个字的拼音首字母构成所需的字符串 #region  获取首字母 /// <summary>         /// 这个办法是用来获得一个字符串的每个字的拼音首字母构成所需的字符串         /// </summary>         /// <param name="str"></param>         /// <returns></returns>         publi…
C#获取字符拼音首字母,可以存储在数据库中以备将来按字母搜索的需求. public static string GetAc(string s) { try { string temp = Service.Text.Chinese2Spell.MakeSpellCode(s, Service.Text.SpellOptions.EnableUnicodeLetter).ToUpper(); ) , ); return temp; } catch { return ""; } } sql端…