@@ -52,7 +52,7 @@ public class PinyinUtils {
|
|||||||
if (arr[i] > 128) {
|
if (arr[i] > 128) {
|
||||||
try {
|
try {
|
||||||
String[] temp = PinyinHelper.toHanyuPinyinStringArray(arr[i], Static.defaultFormat);
|
String[] temp = PinyinHelper.toHanyuPinyinStringArray(arr[i], Static.defaultFormat);
|
||||||
if (temp != null) {
|
if (temp != null && temp.length > 0) {
|
||||||
pybf.append(temp[0].charAt(0));
|
pybf.append(temp[0].charAt(0));
|
||||||
}else{
|
}else{
|
||||||
pybf.append(String.valueOf(arr[i]));
|
pybf.append(String.valueOf(arr[i]));
|
||||||
@@ -155,7 +155,7 @@ public class PinyinUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
// String str = "你好,123,世界abc,~!#$_Sdf,女;hello!-";
|
// String str = "你好,123,🅻🅾🆅🅴、世界abc,~!#$_Sdf,女;hello!-";
|
||||||
// System.out.println(getFirstSpell(str));
|
// System.out.println(getFirstSpell(str));
|
||||||
// System.out.println(getFirstSpell(str, false));
|
// System.out.println(getFirstSpell(str, false));
|
||||||
// System.out.println(getFullSpell(str));
|
// System.out.println(getFullSpell(str));
|
||||||
|
|||||||
Reference in New Issue
Block a user