Java String Camel Case to Underscore camelToUnder(String value)

Here you can find the source of camelToUnder(String value)

Description

convierte el string value de formato camelcase to underscore

License

Open Source License

Parameter

Parameter Description
value a parameter

Declaration

public static String camelToUnder(String value) 

Method Source Code

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

public class Main {
    /**// w w w.j  a  va  2 s.co m
     * convierte el string value de formato camelcase to underscore
     * @param value
     * @return
     */
    public static String camelToUnder(String value) {
        String regex = "([a-z])([A-Z])";
        String replacement = "$1_$2";

        return value.replaceAll(regex, replacement).toLowerCase();

    }
}

Related

  1. camelCaseToUnderscore(String camelCased)
  2. camelCaseToUnderScore(String key)
  3. camelCaseToUnderscored(String camelCaseName)
  4. camelCaseToUnderscores(String camel)
  5. camelCaseToUnderScoreUpperCase(String camelCase)
  6. camelToUnderline(String param)
  7. camelToUnderlinedName(String name)
  8. camelToUnderLineString(String str)
  9. camelToUnderscore(String value)