Here you can find the source of toLowerCaseWithUnderscores(String className)
public static String toLowerCaseWithUnderscores(String className)
//package com.java2s; //License from project: Apache License public class Main { public static String toLowerCaseWithUnderscores(String className) { StringBuilder sb = new StringBuilder(); for (char c : className.toCharArray()) { if (c >= 'A' && c <= 'Z' && sb.length() > 0) { sb.append('_'); }/*ww w . j a v a2 s .c om*/ sb.append(Character.toLowerCase(c)); } return sb.toString(); } }