汉字转换成拼音

来源:互联网 发布:linux下卸载oracle11g 编辑:程序博客网 时间:2024/05/01 11:22

java代码

City entity=null;

if(city.getId()!=null){

entity = this.getById(city.getId());

entity.setName(city.getName());

entity.setPid(city.getPid());

entity.setPinying(ChineseUtils.toPinyin(city.getName(),

         PinyinFormat.TONELESS_PINYIN_FORMAT));


引用资源包  

com/luhuiguo/chinese-utils/1.0/chinese-utils-1.0.jar

引用类 

import com.luhuiguo.chinese.pinyin.Pinyin;

import com.luhuiguo.chinese.pinyin.PinyinFormat;


0 0