如何在Java中将蛇案例转换为驼峰案例?
输入:“input_in_snake_case”
输出:“InputInSnakeCase”
答案 0 :(得分:82)
import com.google.common.base.CaseFormat;
public class StackOverflow25680258 {
public static void main(String[] args) {
System.out.println(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "input_in_snake_case"));
}
}
输出
InputInSnakeCase