Java String Camel Case camelCase(String key)

Here you can find the source of camelCase(String key)

Description

camel Case

License

Apache License

Declaration

public static String camelCase(String key) 

Method Source Code

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

public class Main {
    public static String camelCase(String key) {
        StringBuilder sb = new StringBuilder(key.length());
        boolean upper = true;
        for (int i = 0; i < key.length(); i++) {
            char c = key.charAt(i);
            if (upper) {
                sb.append(Character.toUpperCase(c));
            } else {
                sb.append(Character.toLowerCase(c));
            }/*from ww w.  j  a va  2 s . c  o  m*/
            upper = c == '-';
        }
        return sb.toString();
    }
}

Related

  1. camelCase(String content)
  2. camelCase(String in)
  3. camelCase(String in)
  4. camelCase(String input)
  5. camelCase(String inStr, int start, int end)
  6. camelCase(String name, boolean capitalize)
  7. camelCase(String s)
  8. camelCase(String s)
  9. camelCase(String s)