Here you can find the source of toSnakeCase(String src)
public static String toSnakeCase(String src)
//package com.java2s; //License from project: Open Source License public class Main { public static String toSnakeCase(String src) { String dst = new String(); for (int i = 0; i < src.length(); i++) { char c = src.charAt(i); if ('A' <= c && c <= 'Z') { c += 32;//from w w w. j a v a 2s .c o m if (i != 0) { dst += '_'; } } dst += c; } return dst; } }