Java Utililty Methods String Camel Case Format

List of utility methods to do String Camel Case Format

Description

The list of methods to do String Camel Case Format are organized into topic(s).

Method

StringtoCamelCase(String s)
to Camel Case
if (s == null) {
    return null;
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++) {
    char c = s.charAt(i);
...
StringtoCamelCase(String s)
to Camel Case
if (s == null || s.trim().length() == 0) {
    return s;
String[] parts = s.split(" ");
StringBuilder sb = new StringBuilder();
for (String part : parts) {
    String newPart = part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase();
    sb.append(newPart + " ");
...
StringtoCamelCase(String s)
to Camel Case
if (s == null)
    return null;
if (s.isEmpty() || !Character.isLetter(s.codePointAt(0)))
    return s;
char prefix = s.charAt(0);
prefix = Character.toUpperCase(prefix);
String suffix = s.substring(1);
for (int i = 0; i < suffix.length(); ++i) {
...
StringtoCamelCase(String s)
to Camel Case
String[] parts = s.split("_");
String camelCaseString = "";
for (String part : parts) {
    camelCaseString = camelCaseString + toFirstUpperCase(part);
return camelCaseString;
StringtoCamelCase(String s)
to Camel Case
return toCamelCase(s, DEFAULT_CAMEL_CASE_SPLIT, false);
StringtoCamelCase(String s)
to Camel Case
String[] parts = s.split("_");
if (parts.length == 0) {
    return s.toLowerCase();
String camelCaseString = "";
for (int i = 0; i < parts.length; i++) {
    if (i == 0) {
        camelCaseString = parts[i].toLowerCase();
...
StringtoCamelCase(String s, boolean firstCharUppercase)
to Camel Case
char[] cl = s.toCharArray();
StringBuffer sb = new StringBuffer();
boolean upper = firstCharUppercase;
for (char ch : cl) {
    switch (ch) {
    case '_':
    case '?':
    case ';': 
...
StringtoCamelCase(String s, Boolean firstUpper)
to Camel Case
char[] string = s.toCharArray();
int len = 0;
boolean nextUpper = firstUpper;
for (int i = 0; i < string.length; i++) {
    char c = string[i];
    if (c == '_') {
        nextUpper = true;
    } else if (nextUpper) {
...
StringtoCamelCase(String s, String separator, boolean capitalizeFirstPart)
Turns the string into CamelCase.
String[] parts = s.split(separator);
String result = capitalizeFirstPart ? toCapitalCase(parts[0]) : parts[0];
for (int i = 1; i < parts.length; i++) {
    result += toCapitalCase(parts[i]);
return result;
StringtoCamelCase(String start)
to Camel Case
if (nullOrVoid(start)) {
    return "";
} else {
    final StringBuffer sb = new StringBuffer();
    for (String s : start.toLowerCase().split("_")) {
        if (sb.length() > 1) {
            sb.append(Character.toUpperCase(s.charAt(0)));
        } else {
...