| 123456789101112131415161718192021222324 |
- package com.ydtech.utils;
- import com.github.promeg.pinyinhelper.Pinyin;
- /**
- * Created by zhouhao on 16-6-18.
- */
- public class PinyinUtils {
- /**
- * 获取汉字全拼
- *
- * @param str 汉字字符串
- * @return 汉字字符串全拼
- */
- public static String toPingYin(String str) {
- return Pinyin.toPinyin(str, "").toLowerCase();
- }
- public static void main(String[] args) {
- String ping = toPingYin("中国重庆");
- System.out.println(ping);
- }
- }
|