package {{basePackage}}.utils.str;

import cn.hutool.extra.pinyin.PinyinUtil;

/**
 * dcrenl: 2023-09-07 13:18:28
 * 字符串处理
 */
public class strUtils {

    /**
     * dcrenl: 2023-09-07 13:18:46
     * 获取字符串拼音全拼
     * @param str
     * @return
     */
    public static String getPinyin(String str) {
        return PinyinUtil.getPinyin(str);
    }

    /**
     * dcrenl: 2023-09-07 13:18:46
     * 获取字符串拼音全拼
     * @param str
     * @param separator 分割符
     * @return
     */
    public static String getPinyin(String str, String separator) {
        return PinyinUtil.getPinyin(str, separator);
    }

    /**
     * dcrenl: 2023-09-07 13:23:0
     * 获取简拼
     * @param str
     * @return
     */
    public static String getPY(String str) {
        return PinyinUtil.getFirstLetter(str, "");
    }

    /**
     * dcrenl: 2023-09-07 13:23:0
     * 获取简拼
     * @param str
     * @param separator
     * @return
     */
    public static String getPY(String str, String separator) {
        return PinyinUtil.getFirstLetter(str, separator);
    }
}
