Java Utililty Methods String Camel Case

List of utility methods to do String Camel Case

Description

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

Method

StringcamelCase(CharSequence... components)
camel Case
StringBuilder sb = new StringBuilder();
boolean start = true;
for (CharSequence comp : components) {
    if (comp != null && comp.length() == 0) {
        if (start) {
            sb.append(comp);
            start = false;
        } else {
...
StringcamelCase(final String input)
camel Case
if (input.contains(" ")) {
    final String[] strings = input.split(" ");
    final StringBuilder sb = new StringBuilder();
    for (final String s : strings) {
        sb.append(s.substring(0, 1).toLowerCase()).append(s.substring(1).toLowerCase()).append(" ");
    return sb.toString();
return input.substring(0, 1).toLowerCase() + input.substring(1).toLowerCase();
StringcamelCase(final String prefix, final String str)
camel Case
return prefix.toLowerCase() + str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase();
StringcamelCase(final String text)
camel Case
if (text == null) {
    throw new IllegalArgumentException("text");
for (final String acronym : ACRONYMS) {
    if (acronym.equals(text)) {
        return text;
for (final String acronym : ACRONYMS) {
    if (text.startsWith(acronym)) {
        return acronym.toLowerCase().concat(text.substring(acronym.length()));
return text.substring(0, 1).toLowerCase().concat(text.substring(1));
StringcamelCase(final String value, final String delim)
converts string to camel case, using the specified string delimeter
if (value == null || value.isEmpty()) {
    return "";
final StringBuilder result = new StringBuilder(value.length());
final String[] parts = value.split(delim);
if (parts != null && parts.length > 0) {
    boolean mustCapitalize = false;
    for (final String part : parts) {
...
StringcamelCase(String column)
camel Case
StringBuffer newColumn = new StringBuffer();
boolean underScoreFound = false;
int index = -1;
int currentPosition = 0;
while ((index = column.indexOf('_', currentPosition)) > -1) {
    newColumn.append(column.substring(currentPosition, index).toLowerCase());
    newColumn.append(column.substring(index + 1, index + 2).toUpperCase());
    currentPosition = index + 2;
...
StringcamelCase(String content)
Converts `string` to [camel case]
StringBuilder result = new StringBuilder();
int i = 0;
for (String word : content.replaceAll("[^a-zA-Z0-9]", " ").split(NATURAL_TEXT_SPLITTER)) {
    word = word.toLowerCase();
    if (i == 0) {
        result.append(word);
    } else {
        result.append(firstUpper(word));
...
StringcamelCase(String in)
Camel case anY STRING given as InPuT.
returns :
CamelCaseAnyStringGivenAsInput.
return removeWhiteSpaces(capitalize(in.toLowerCase(), true));
StringcamelCase(String in)
camel Case
String s = "";
String[] split = in.replace('_', ' ').split(" ");
for (int i = 0; i < split.length; i++) {
    if (i == 0)
        s += split[i].toLowerCase();
    else
        s += split[i].substring(0, 1).toUpperCase() + split[i].substring(1).toLowerCase();
return s;
StringcamelCase(String input)
camel Case
return input.substring(0, 1).toLowerCase() + input.substring(1);