首页>代码>SpringBoot+vue前后端分离-模板项目,适合新手小白二次开发,太香了>/EasyJavaTemplate/GenteratorCode/src/main/java/wujiangbo/tools/MyUtils.java
package wujiangbo.tools; /** * 工具类 * @author 波波老师(weixin:javabobo0513) */ public class MyUtils { public static void main(String[] args){ System.out.println(convert("t_", "t_user_demo")); } //单词所有下划线去掉,并且驼峰转换 public static String convert(String pre, String source) { StringBuffer sbf = new StringBuffer(); if (source.contains(pre)) { // 按下划线来切割字符串为数组 String[] split = source.split("_"); // 循环数组操作其中的字符串 for (int i = 1, index = split.length; i < index; i++){ String temp = split[i]; if(i == 1){ sbf.append(temp); }else{ sbf.append(temp.substring(0, 1).toUpperCase() + temp.substring(1)); } } }else{ sbf.append(source); } return sbf.toString(); } public static String getEntityName(String source) { StringBuffer sbf = new StringBuffer(); // 按下划线来切割字符串为数组 String[] split = source.split("_"); // 循环数组操作其中的字符串 for(int i=0; i<split.length; i++){ String word_temp = split[i]; if(i == 0){ sbf.append(word_temp); }else{ sbf.append(word_temp.substring(0, 1).toUpperCase() + word_temp.substring(1)); } } return sbf.toString(); } }

denliv_hui LV14
8月1日
5418888 LV3
5月13日
quyan5632 LV2
2月10日
huasir2018 LV14
1月29日
AprilZk LV3
2024年12月12日
zolscy LV24
2024年11月26日
微信网友_7134912998903808 LV15
2024年8月29日
叁卍石 LV5
2024年8月21日
Oxygeni LV7
2024年7月14日
llllllK LV5
2024年5月13日