当前位置:网站首页>Use of hutool Pinyin tool

Use of hutool Pinyin tool

2022-07-04 05:29:00 Rookie pig man YY

Hutool Use of Pinyin tools

Import dependence

1. Import dependence
Because I just want to test , So what I import is jar package , If it is maven The project enters the pom.xml Just import the corresponding dependency in the file ( stay maven In the official website )

Import is required here 2 Dependencies :
1.hutool-all-5.4.1.jar package
2.pinyin4j-2.5.0.jar package

Use

1. Get Chinese initials

// Get the initial 
		String letter= PinyinUtil.getFirstLetter(" Hello ","");
		System.out.println(" Hello initials :"+letter); // nh
原网站

版权声明
本文为[Rookie pig man YY]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141642557528.html