工具类—>汉字转拼音
1、之前用过这款,使用稍微有点麻烦,导入依赖,使用PinyinHelper进行操作,也有一些前辈稍微封装了一些工具类简化使用
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
2.今天发现这款,就更简单利索咯,API命名也规范@see
<dependency>
<groupId>net.duguying.pinyin</groupId>
<artifactId>pinyin</artifactId>
<version>0.0.1</version>
</dependency>
简单测试如下