CamelCase
@param  {String} str String with "under_score"
@return {String} UnderScore is now CamelCased
186693
function camelCase(str) {
  var capitaliseLead = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];

  str = str.replace(/_([a-z])/g, function (group) {
    if (group[1]) {
      return group[1].toUpperCase();
    }
  });
  if (capitaliseLead) {
    return str.charAt(0).toUpperCase() + str.slice(1);
  } else {
    return str;
  }
}
1270908
function camelcase(val) {
    if (!is_1.isValue(val))
        return null;
    var result = val.replace(/[^A-Za-z0-9]/g, ' ').replace(/^\w|[A-Z]|\b\w|\s+/g, function (m, i) {
        if (+m === 0 || /(\.|-|_)/.test(m))
            return '';
        return i === 0 ? m.toLowerCase() : m.toUpperCase();
    });
    return result.charAt(0).toLowerCase() + result.slice(1);
}
937844
function (input) {
        function camelCaseSingle(input) {
        return String(input).toLowerCase().replace(/[-|\s](.)/g, function (match, group1) {
            return group1.toUpperCase();
        });
        }

        if(typeof input == 'string')
            return camelCaseSingle(input);
        else
            return input.map(camelCaseSingle);
    }
203316
static public function camelToUnderscore($str, $replace = false)
    {
        $str = preg_replace('/(?<=\w)([A-Z])(?=[a-z]+)/', "_$1", trim($str));
        $str = $replace ? str_replace(" ", "_", $str) : $str;

        return strtolower($str);
    }
931919
function snakeCase (str) {
  return str
    .replace(/([a-z])([A-Z])/g, match => match[0] + '_' + match[1])
    .replace(invalidChars, '_')
    .toLowerCase()
}
6635
private static String camelFormat(String str, boolean isFirstCapitalized) {
		StringBuilder builder = new StringBuilder(str.length());
		String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
		for (int i = 0; i < tokens.length; i++) {
			String lowerCased = StringUtils.lowerCase(tokens[i]);
			if (i == 0) {
				builder.append(isFirstCapitalized ? StringUtils.capitalize(lowerCased) : lowerCased);
			} else {
				builder.append(StringUtils.capitalize(lowerCased));
			}
		}
		return builder.toString();
	}
1182987
public static int getStringCase(String str) {
        if (str.length() == 0) {
            return MIXED;
        }

        int state = -1;

        char ch = str.charAt(0);
        if (Character.isLetter(ch)) {
            if (Character.isUpperCase(ch)) {
                state = UPPER_CASE;
            } else {
                state = LOWER_CASE;
            }
        }

        for (int i = 1; i < str.length(); i++) {
            ch = str.charAt(i);
            if (!Character.isLetter(ch)) {
                continue;
            }

            switch (state) {
                case UPPER_CASE:
                    if (Character.isLowerCase(ch)) {
                        if (i == 1) {
                            state = TITLE_CASE;
                        } else {
                            return MIXED;
                        }
                    }
                    break;
                case LOWER_CASE:
                case TITLE_CASE:
                    if (Character.isUpperCase(ch)) {
                        return MIXED;
                    }
                    break;
            }
        }

        return state;
    }
55883
function camelcase(flag) {
  return flag.split('-').reduce(function(str, word){
    return str + word[0].toUpperCase() + word.slice(1);
  });
}
998697
def snake_case(str)
      return str.downcase if str.match(/\A[A-Z]+\z/)
      str.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
        gsub(/([a-z])([A-Z])/, '\1_\2').
        downcase
    end
1319612
function camelCaseToUnderscoreMap(columns) {
    var map = {};
    for (var i = 0; i < columns.length; i++)
        map[columns[i]] = toUnderscore(columns[i]);
    return map;
}
1269482
public static function toSlugUnderscoreUppercase(string $str)
  {
    $clean = implode(' ', self::splitCamelCase($str));
    $clean = self::toSlug($clean);
    $clean = self::toUnderscoreSeparated($clean);
    $clean = strtoupper($clean);
    return $clean;
  }
58502
function camelCase(s) {
  return s.toLowerCase().replace(/-(.)/g, function(m, g) {
    return g.toUpperCase()
  })
}
329556
public static String underscore(String camel) {

        StringBuilder bob = new StringBuilder(camel); // standard adds 16 extra slots for underscores
        
        // lowercase the first letter
        if (camel.charAt(0) >= 'A' && camel.charAt(0) <= 'Z')
            bob.setCharAt(0, Character.toLowerCase(camel.charAt(0)));
        
        int extra = 0;
        // i = 1, because we already lowered it
        for (int i = 1; i < camel.length(); i++) {
            char b = camel.charAt(i);
            if (b >= 'A' && b <= 'Z') { // within range
                // lower it
                bob.setCharAt(i + extra, Character.toLowerCase(b));
                // add underscore
                bob.insert(i + extra++, '_');
            }
        }

        return bob.toString();
    }
74633
private function toCamelCase($str): string
    {
        $func = function ($c) {
            return strtoupper($c[1]);
        };

        return preg_replace_callback('/_([a-z])/', $func, $str);
    }
717153
function camelCase(s) {
    // Convert first character to lowercase
    return s.replace(/^\w/, function (match) {
        return match.toLowerCase();
    })
    .replace(/-\w/g, function (match) {
        return match.charAt(1).toUpperCase();
    });
}
1318877
public static String toCamelCase(String str) {
		String[] wordList = str.toLowerCase().split("_");
		String finalStr = "";
		for (String word : wordList) {
			finalStr += capitalize(word);
		}
		return finalStr;
	}
390551
function camelCase(str) {
            return str.replace(reMs, "ms-").replace(reSnakeCase, function (all, letter) {
                return letter.toUpperCase();
            });
        }