public class FirstLetterUtil { private static int BEGIN = 45217; private static int END = 63486; // 按照声母表示,这个表是在GB2312中的出现的第一个汉字,也就是说"啊"是代表首字母a的第一个汉字. // i, u, v都不做声母, 自定规则跟随前面的字母 private static char[] chartable = {'啊', '芭', '擦', '搭', '蛾', '发',…
public class Da { public static void main(String[] args) { String s = "hello_*java_*world"; System.out.println("转化前:"+s); String[] strs = s.split("_\\*"); String ret = ""; for(int i = 0; i < strs.length; i++){ if…
C#获取包括一二级汉字的拼音 首字母 声母 汉字拼音转换 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.Globalization; using System.Threading; using System.Data; using System.Text.RegularExpressions;…
参考: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 { /…
1.首先在NuGet安装pingyinConverter 2.下载-安装-引用ChineseChar.dll到项目中 官网了解:http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=15251 3.直接上代码了 public class PinYinConverterHelp { public static PingYinModel GetTotalPingYin(string str) { var chs = str.ToCh…