提交 4b46ece6 编写于 作者: Skyeye云's avatar Skyeye云

字符串首字母转小写

上级 fedd8847
......@@ -475,6 +475,18 @@ public class ToolUtil {
String result = sb.toString().replaceAll("_", "");
return StringUtils.capitalize(result);
}
/**
* 首字母转小写
* @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();
}
public static void main(String[] args) throws Exception {
......
......@@ -21,4 +21,5 @@ findChildren(); 递归查找子节点
getIPPropertiesPath(); 获取ip.properties路径
deleteFile(); 删除单个文件
card(); 随机不重复的6-8位
replaceUnderLineAndUpperCase(); 将表名转为Java经常使用的名字,如code_model转CodeModel
\ No newline at end of file
replaceUnderLineAndUpperCase(); 将表名转为Java经常使用的名字,如code_model转CodeModel
toLowerCaseFirstOne(); 字符串首字母转小写
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册