Here you can find the source of camelToUnderline(String param)
public static String camelToUnderline(String param)
//package com.java2s; //License from project: Open Source License public class Main { public static String camelToUnderline(String param) { if (param == null || param.length() == 0) { return param; }// w ww. j av a 2 s . co m int len = param.length(); StringBuilder sb = new StringBuilder(len); for (int i = 0; i < len; i++) { char c = param.charAt(i); if (Character.isUpperCase(c)) { sb.append('_'); sb.append(Character.toLowerCase(c)); } else { sb.append(c); } } return sb.toString(); } }