mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add PinyinUtil
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package cn.hutool.extra.pinyin;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class PinyinUtilTest {
|
||||
|
||||
@Test
|
||||
public void toPinyinTest(){
|
||||
final String pinyin = PinyinUtil.toPinyin("你好", false);
|
||||
Assert.assertEquals("ni hao", pinyin);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toPinyinUpperCaseTest(){
|
||||
final String pinyin = PinyinUtil.toPinyin("你好怡", true);
|
||||
Assert.assertEquals("NI HAO YI", pinyin);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user