Java String Camel Case To camelToComposite(String camel)

Here you can find the source of camelToComposite(String camel)

Description

camel To Composite

License

Open Source License

Declaration

public static String camelToComposite(String camel) 

Method Source Code

//package com.java2s;

public class Main {

    public static String camelToComposite(String camel) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < camel.length(); i++) {
            char ch = camel.charAt(i);
            if (i > 0 && Character.isUpperCase(ch)) {
                sb.append('_');
                sb.append(ch);/*from ww w .j a  v  a 2 s .co m*/
            } else {
                sb.append(Character.toUpperCase(ch));
            }
        }
        return sb.toString();
    }

    public static String toString(Object[] strArr) {
        StringBuilder sb = new StringBuilder();
        boolean flag = true;
        for (Object str : strArr) {
            if (flag) {
                flag = false;
            } else {
                sb.append(',');
            }
            sb.append(str);
        }
        return sb.toString();
    }
}

Related

  1. camelHump(String str)
  2. camelHumpsToWords(String camelHumps)
  3. camelhumpToUnderline(String str)
  4. camelizeOneWord(String word, boolean firstLetterInLowerCase)
  5. camelPrefix(String str, int prefixSize)
  6. camelToFixedString(String str, String fixed)
  7. camelToLisp(final String pString)
  8. camelToLowerSnake(String camel)
  9. camelToPeriod(String value)