Java String Decamel Case deCamelize(String value)

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

Description

de Camelize

License

Apache License

Declaration

public static String deCamelize(String value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String deCamelize(String value) {
        if (value == null) {
            return null;
        }//from w  w  w  .j a va2s . c  o  m

        StringBuilder deCamelized = new StringBuilder(value.length() + 10);
        for (int i = 0; i < value.length(); i++) {
            if (Character.isUpperCase(value.charAt(i)) && deCamelized.length() > 0) {
                deCamelized.append('_');
            }
            deCamelized.append(Character.toUpperCase(value.charAt(i)));
        }
        return deCamelized.toString();
    }
}

Related

  1. deCamelCase(String identifier)
  2. deCamelCaseStyle(String style)
  3. decamelise(String testName)
  4. decamelize(final String s)
  5. decamelize(String s)
  6. decamelizeAndReplaceByHyphen(String s)