Here you can find the source of toUnderscoreSeparated(String name)
public static String toUnderscoreSeparated(String name)
//package com.java2s; //License from project: Apache License public class Main { public static String toUnderscoreSeparated(String name) { if (name == null) { return name; }// w w w . ja v a 2 s . co m return name.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase(); } }