Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    static String toDbColumName(String name) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0, size = name.length(); i < size; i++) {
            char c = name.charAt(i);
            if (c >= 'A' && c <= 'Z') {
                sb.append("_" + Character.toLowerCase(c));
            } else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}