Java examples for java.lang:String Camel Case
camel Case To Dot Case by regex
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String name = "java2s.com"; System.out.println(camelCaseToDotCase(name)); }//from w w w . j a v a 2 s .c om public static String camelCaseToDotCase(String name) { return name.replaceAll( String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])"), ".").toLowerCase(); } }