package com.jiayue.ipfcst.common.core.util;

/**
 * 字符串工具类
 *
 * @author zzy
 * @version 1.0
 * @since 2019/6/24 10:07
 */
public class StringUtil {

    /**
     * 首字母转小写
     *
     * @param s 字符串
     * @return 首字母小写字符串
     */
    public static String toLowerCaseFirstOne(String s) {
        if (Character.isLowerCase(s.charAt(0))) {
            return s;
        } else {
            return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
        }
    }


    /**
     * 首字母转大写
     *
     * @param s 字符串
     * @return 首字母大写字符串
     */
    public static String toUpperCaseFirstOne(String s) {
        if (Character.isUpperCase(s.charAt(0))) {
            return s;
        } else {
            return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
        }
    }
}
