文件名称:Java汉字转拼音和首字母
文件大小:194KB
文件格式:ZIP
更新时间:2020-11-22 10:31:59
pinyin
Java实现汉字转拼音功能,包括 首字母和全拼 for (int j = 0, int len = str.length(); j < len; j++) { char word = str.charAt(j); String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word); if (pinyinArray != null) { convert += pinyinArray[0].charAt(0); } else { convert += word; } } return convert;
【文件预览】:
pinyin4j-2.5.0.jar