Java String Camel Case Format toCamelCase(String value, String separator)

Here you can find the source of toCamelCase(String value, String separator)

Description

to Camel Case

License

Apache License

Declaration

public static String toCamelCase(String value, String separator) 

Method Source Code

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

public class Main {
    public static String toCamelCase(String value, String separator) {
        StringBuilder sb = new StringBuilder();
        for (String part : value.split(separator)) {
            if (part.isEmpty())
                continue;
            sb.append(part.substring(0, 1).toUpperCase());
            if (part.length() > 1)
                sb.append(part.substring(1));
        }/*w  w w . ja  v  a 2 s .co m*/
        return sb.toString();
    }
}

Related

  1. toCamelCase(String value)
  2. toCamelCase(String value)
  3. toCamelCase(String value)
  4. toCamelCase(String value)
  5. toCamelCase(String value)
  6. toCamelCaseCapitalize(String underLineName)
  7. toCamelCaseIdentifier(String formStr)
  8. toCamelCaseIgnoringLastChar(String string, String delimiter, boolean upperFirst)
  9. toCamelCasePresevingExisting(String s)