Here you can find the source of underscoreAndLowercase(String s)
private static String underscoreAndLowercase(String s)
//package com.java2s; //License from project: Open Source License public class Main { private static String underscoreAndLowercase(String s) { return s.replaceAll(String.format("%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])"), "_") .toLowerCase();//from w w w .jav a 2 s . c om } }