Turns a camel case string into an underscored one, e.g. "HelloWorld"
becomes "hello_world".

@param camelCaseString the string to underscore
@return the underscored string
327433
public static String underscore(String camelCaseString) {
        String[] words = splitByCharacterTypeCamelCase(camelCaseString);
        return TextUtils.join("_", words).toLowerCase();
    }
93275
function camelCase(text) {
    text = text || '';
    return text.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => {
        return index === 0 ? letter.toLowerCase() : letter.toUpperCase();
    }).replace(/\s+/g, '');
}
410217
def to_camel_case(text):
    
    split = text.split('_')
    return split[0] + "".join(x.title() for x in split[1:])
1117948
def to_camel_case(snake_case_name):
    
    bits = snake_case_name.split('_')
    return ''.join([bit.capitalize() for bit in bits])
130229
def _to_camelcase(input_string):
    ''' '''
    camel_string = ''
    for i in range(len(input_string)):
        if input_string[i] == '_':
            pass
        elif not camel_string:
            camel_string += input_string[i].upper()
        elif input_string[i-1] == '_':
            camel_string += input_string[i].upper()
        else:
            camel_string += input_string[i]
    return camel_string
769428
def camel_to_underscore(name):
    
    as_list = []
    length = len(name)
    for index, i in enumerate(name):
        if index != 0 and index != length - 1 and i.isupper():
            as_list.append('_%s' % i.lower())
        else:
            as_list.append(i.lower())

    return ''.join(as_list)
1108142
public static String toTitleCase( final String camel )
    {
        if (camel==null) {
            return null;
        }
        StringBuffer    buffer = new StringBuffer( camel.length() + 10 );
        char            ch;

        //      TBD: needs refactoring, cleanup, method cohesiveness, SRP.
        for ( int ii = 0; ii < camel.length(); ii++ )
        {
            ch = camel.charAt( ii );

            //
            //      This will handle lower camel and avoid adding a
            //          space at the start
            //
            if ( ii == 0 )
            {
                if ( Character.isLowerCase( ch ) )
                {
                    buffer.append( Character.toUpperCase( ch ) );
                }
                else
                {
                    buffer.append( ch );
                }
            }
            else
            {
                if ( Character.isUpperCase( ch ) )
                {
                    buffer.append( " " ).append( ch );
                }
                else
                {
                    buffer.append( ch );
                }
            }
        }

        return buffer.toString();
    }
339467
private function underscoreToCamelCase($string, $firstCharCaps = false)
    {
        if ($firstCharCaps == true) {
            $string[0] = strtoupper($string[0]);
        }

        $func = create_function('$c', 'return strtoupper($c[1]);');

        return preg_replace_callback('/_([a-z])/', $func, $string);
    }
1329454
def camel_to_underscore(string):
    
    string = FIRST_CAP_RE.sub(r'\1_\2', string)
    return ALL_CAP_RE.sub(r'\1_\2', string).lower()
1089767
public static function string_to_camelcase( $string, $capitalize = true ){
  	$normalize_string = str_replace( array( '-', '_' ), ' ', $string );
  	$ucwords = ucwords( $normalize_string, ' ' );
  	$camelcase_string = str_replace(' ', '', $ucwords);
    if( ! $capitalize ) {
    	$camelcase_string = lcfirst( $camelcase_string );
    }
    return $camelcase_string;
  }
552338
String getName(TypeName typeName) {
    String name = typeToNames.get(typeName);
    if (name != null) {
      return name;
    }
    name = getNameInternal(typeName);
    name = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, name);
    name = adapterNames.getUniqueName(name);
    typeToNames.put(typeName, name);
    return name;
  }
1351011
static String toLowerCamelCaseWithNumericSuffixes(String input) {
    // Determine where the numeric suffixes begin
    int suffixStart = input.length();
    while (suffixStart > 0) {
      char ch = '\0';
      int numberStart = suffixStart;
      while (numberStart > 0) {
        ch = input.charAt(numberStart - 1);
        if (Character.isDigit(ch)) {
          numberStart--;
        } else {
          break;
        }
      }
      if ((numberStart > 0) && (numberStart < suffixStart) && (ch == '_')) {
        suffixStart = numberStart - 1;
      } else {
        break;
      }
    }

    if (suffixStart == input.length()) {
      return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, input);
    } else {
      return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL,
          input.substring(0, suffixStart)) + input.substring(suffixStart);
    }
  }
465348
public static String labelFromCamelCase(String camel) {
		StringBuilder label = new StringBuilder();
		for (int i = 0; i < camel.length(); i++) {
			char c = camel.charAt(i);
			if (Character.isDigit(c)) {
				if (i > 0 && Character.isAlphabetic(camel.charAt(i - 1)))
					label.append(" ");
			}
			if (c == '_') {
				label.append(" ");
			} else if (Character.isUpperCase(c)) {
				label.append(' ');
				label.append(Character.toLowerCase(c));
			} else {
				label.append(c);
			}
		}
		return label.toString();
	}
720585
public static String snakeCaseToCamelCase(String snakeCase) {
		if(snakeCase.contains("-")) {
			StringBuilder camelCaseStr = new StringBuilder(snakeCase.length());
			boolean toUpperCase = false;
			for (char c : snakeCase.toCharArray()) {
				if (c == '-')
					toUpperCase = true;
				else {
					if (toUpperCase) {
						toUpperCase = false;
						c = Character.toUpperCase(c);
					}
					camelCaseStr.append(c);
				}
			}
			snakeCase = camelCaseStr.toString();
		}
		return snakeCase;
	}
289292
def snake_to_camel_case(name):
    
    name = name.replace("-", "_")
    return "".join(word.capitalize() for word in name.split("_"))
417774
def underscore_to_camelcase(underscore_string)
      underscore_string = underscore_string.gsub(/(_)/,' ').split(' ').each { |word| word.capitalize! }.join("") unless underscore_string.match(/_/).nil?
      underscore_string = underscore_string if underscore_string.match(/_/).nil?
      return underscore_string
    end
587558
public static String hyphenCaseToCamelCase(String s) {

        List<String> words = Stream.of(s.split("-")).filter(w -> !"".equals(w)).collect(Collectors.toList());

        if (words.size() < 2) {
            return s;
        }

        StringBuilder parsedString = new StringBuilder(words.get(0));

        for (int i = 1; i < words.size(); i++) {

            parsedString.append(Character.toUpperCase(words.get(i).charAt(0))).append(words.get(i).substring(1));
        }

        return parsedString.toString();
    }