1.添加依赖 implementation 'com.belerweb:pinyin4j:2.5.0' 2.kotlin代码如下 import net.sourceforge.pinyin4j.PinyinHelper object PinyinUtils { fun getUpperFirstWord(s:String): String { val pinyinArray = PinyinHelper