Java String Decamel Case decamelise(String testName)

Here you can find the source of decamelise(String testName)

Description

decamelise

License

Open Source License

Declaration

public static String decamelise(String testName) 

Method Source Code

//package com.java2s;

public class Main {
    public static String decamelise(String testName) {
        String nocamel = charAtToUpper(0, testName);
        for (int i = 1; i < testName.length(); i++) {
            char nextChar = testName.charAt(i);
            if (isUpper(nextChar)) {
                nocamel += spaceAndToLower(nextChar);
            } else {
                nocamel += nextChar;/*from   w  w  w. j a v  a 2s .  c  o m*/
            }
        }
        return nocamel;
    }

    private static String charAtToUpper(int at, String text) {
        return (text.charAt(at) + "").toUpperCase();
    }

    private static boolean isUpper(char nextChar) {
        return nextChar >= 'A' && nextChar <= 'Z';
    }

    private static String spaceAndToLower(char character) {
        return " " + (character + "").toLowerCase();
    }
}

Related

  1. deCamelCap(String s)
  2. deCamelCase(final String original)
  3. deCamelCase(String camelCased, String delim)
  4. deCamelCase(String identifier)
  5. deCamelCaseStyle(String style)
  6. decamelize(final String s)
  7. decamelize(String s)
  8. deCamelize(String value)
  9. decamelizeAndReplaceByHyphen(String s)