You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.5 KiB

10 months ago
package com.dsideal.Utils;
import cn.hutool.core.date.DateUtil;
public class dsKit {
/**
*
* @return
*/
public static String getCurrentTimeStr() {
return DateUtil.formatDateTime(DateUtil.date());
}
10 months ago
/**
10 months ago
*
* @param msg
*/
public static void print(String msg){
System.out.println(getCurrentTimeStr()+" "+msg);
}
/**
10 months ago
*
*
* @param input
* @return
*/
public static String capitalizeFirstLetter(String input) {
// 检查输入是否为空或者null
if (input == null || input.isEmpty()) {
return input;
}
// 将第一个字符转换为大写,然后与其余部分拼接
return input.substring(0, 1).toUpperCase() + input.substring(1);
}
/**
*
*/
public static String toCamelCase(String tableName) {
StringBuilder sb = new StringBuilder();
boolean upperCase = false;
for (char c : tableName.toCharArray()) {
if (c == '_') {
upperCase = true;
} else if (upperCase) {
sb.append(Character.toUpperCase(c));
upperCase = false;
} else {
sb.append(c);
}
}
return sb.toString();
}
10 months ago
}