Java examples for java.lang:String Case
underline Between Up Case
//package com.java2s; public class Main { public static void main(String[] argv) { String str = "AbcDefDeDDDD"; System.out.println(underlineBetweenUpCase(str)); }/*from www . j av a 2 s. c o m*/ public static String underlineBetweenUpCase(String str) { return str.replaceAll("(.)(\\p{Lu})", "$1_$2").toLowerCase(); } }