打开excel,按Alt+F11,插入-模块,复制粘贴下边的函数 Function pinyin(p As String) As String i = Asc(p) Select Case i Case - To -: pinyin = "A" Case - To -: pinyin = "B" Case - To -: pinyin = "C" Case - To -: pinyin = "D" Case - To -: p
--获取全拼 DECLARE @str VARCHAR(max) SET @str= [dbo].[fn_Getquanpin]('中山') PRINT(@str) )) ) as begin ),) declare @strlen int select @strlen=len(@str),@re='' begin ) select @re= case when @crs<'吖' then @crs when @crs<='厑' then 'a' when @crs<='靉' then
参考:http://www.jb51.net/article/42217.htmhttp://blog.csdn.net/cstester/article/details/4758172 ChineseToPinyinHelper.cs: using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace FisherComom { /
有时候,可能会有一些类似这样的需求: 对于这样的效果,我们可以有类似这样的解决方案: package bys.utils; import java.io.UnsupportedEncodingException; /** * Created by toutou on 2014/2/21 */ public class ChineseCharacterHelper { static final int GB_SP_DIFF = 160; // 存放国标一级汉字不同读音的起始区位码 static f
--创建取汉字首字母函数(第三版) create function [dbo].[f_getpy_V3] ( ) ) ) as begin ),) ,@len = len(@col),@sql = '' while @cyc <= @len begin ) as varbinary) ),ecode ),letter )) insert into @maco select 0XB0A1,0XB0C4,'A' union all select 0XB0C5,0XB2C0,'B' union all
//获取 汉字首字母 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++) { var ch = str.charAt(i); arrResult.push(checkCh
sql server 提取汉字/数字/字母的方法 --提取数字 IF OBJECT_ID('DBO.GET_NUMBER2') IS NOT NULL DROP FUNCTION DBO.GET_NUMBER2 GO )) ) AS BEGIN BEGIN ,'') END RETURN @S END GO --测试 PRINT DBO.GET_NUMBER('呵呵ABC123ABC') GO ---------------------------------------------------