package com.xjrsoft.xjrsoftboot;

import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
import com.xjrsoft.module.base.entity.BaseClass;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.Map;

/**
 * @author dzx
 * @date 2024/6/14
 */
public class StringTest {

    @Test
    void test2(){

        System.out.println(underscoreToCamel("create_user_id"));
    }

    public static String underscoreToCamel(String input) {
        if (input == null) {
            return input;
        }

        StringBuilder builder = new StringBuilder();
        boolean nextUpperCase = false;

        for (char c : input.toCharArray()) {
            if (c == '_') {
                nextUpperCase = true;
            } else {
                if (nextUpperCase) {
                    builder.append(Character.toUpperCase(c));
                    nextUpperCase = false;
                } else {
                    builder.append(Character.toLowerCase(c));
                }
            }
        }

        return builder.toString();
    }
}
