Java String Camel Case To camelCaseNameToConstant(String camelCaseName)

Here you can find the source of camelCaseNameToConstant(String camelCaseName)

Description

camel Case Name To Constant

License

Open Source License

Declaration

private static String camelCaseNameToConstant(String camelCaseName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String camelCaseNameToConstant(String camelCaseName) {
        if (camelCaseName == null || camelCaseName.isEmpty()) {
            return camelCaseName;
        }//from w  w w  . j  ava2 s  .c o  m

        return camelCaseName.replaceAll("([a-z]{1})([A-Z]{1})", "$1_$2").toUpperCase();
    }
}

Related

  1. camel2underline(String hump)
  2. camel2underline(String s)
  3. camelCase2Delimiter(String name, char delimiter)
  4. camelCaseIt(String mappingName, String separator)
  5. camelCaseMatch(String word, String abbr)
  6. camelCaseOrSpaceToDashed(String s)
  7. camelCasePrefix(String strPrefix)
  8. camelCaseSpace(final String str)
  9. camelCaseToDash(String input)