Given a camel cased word, returns the constant it represents

 constantize('JobName') # => JobName
351095
def constantize(camel_cased_word)
      camel_cased_word = camel_cased_word.to_s

      if camel_cased_word.include?('-')
        camel_cased_word = classify(camel_cased_word)
      end

      names = camel_cased_word.split('::')
      names.shift if names.empty? || names.first.empty?

      constant = Object
      names.each do |name|
        constant = constant.const_get(name) || constant.const_missing(name)
      end
      constant
    end
757309
function _camelcase(flag) {
  return flag.split('-').reduce(function (str, word) {
    return str + word[0].toUpperCase() + word.slice(1);
  });
}
263292
public final int getConstantIndex(String constant)
    {
        int nameIndex = getNameIndex(constant);
        for (ConstantInfo ci : listConstantInfo(ConstantString.class))
        {
            ConstantString ic = (ConstantString) ci;
            if (nameIndex == ic.getString_index())
            {
                return constantPoolIndexMap.get(ci);
            }
        }
        return -1;
    }
707861
def to_constant( v )
      v = v.to_s.upcase
      ColorScheme.const_get(v) if (ColorScheme.const_defined?(v, false) rescue ColorScheme.const_defined?(v))
    end
90893
public static String underscoreSeparated(String camelCaseName) {
        return StringUtils.lowerCase(
                Arrays.stream(StringUtils.split(camelCaseName, SubFacet.SEPARATOR))
                        .flatMap(component -> Arrays.stream(StringUtils.splitByCharacterTypeCamelCase(component)))
                        .collect(Collectors.joining("_")));
    }
1240781
def find_value_for_constant(name)
      constant = YARD::Registry.all(:constant).find{|c| c.name == name.to_sym }
      log.warn "StepTransformer#find_value_for_constant : Could not find the CONSTANT [#{name}] using the string value." unless constant
      constant ? strip_regex_from(constant.value) : name
    end
202442
def convert_camel_case_string(name: str) -> str:
    """"""
    string = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
    return re.sub("([a-z0-9])([A-Z])", r"\1_\2", string).lower()
1352042
function camelize(string) {
  return string.replace(/-+(.)?/g, function(match, character) {
    return character ? character.toUpperCase() : '';
  });
}
308874
function formatName(input, noCamelCase){
	input = input.replace(/^-+/, "");
	
	// Convert kebab-case to camelCase
	if(!noCamelCase && /-/.test(input))
		input = input.toLowerCase().replace(/([a-z])-+([a-z])/g, (_, a, b) => a + b.toUpperCase());
	
	return input;
}
1108618
def camel_case_to_snake_case(name):
    
    s1 = _FIRST_CAP_RE.sub(r'\1_\2', name)
    return _ALL_CAP_RE.sub(r'\1_\2', s1).lower()
284276
def camelize(word):
    
    return ''.join(w[0].upper() + w[1:]
                   for w in re.sub('[^A-Z^a-z^0-9^:]+', ' ', word).split(' '))
995234
def camelize(term)
      string = term.to_s
      string = string.sub(/^[a-z\d]*/) { $&.capitalize }
      string.gsub(/(?:_|(\/))([a-z\d]*)/i) { $2.capitalize }.gsub('/', '::')
    end
729433
def class_case(string):
    
    if not string:
        return string
    string = string.replace(' ', '_').replace('-', '_')
    parts = de_camel(string, '_', _lowercase=False).split('_')
    rv = ''
    while parts:
        part = parts.pop(0)
        rv += part.title() or '_'
        if part:
            break
    return rv + ''.join([part if part.isupper() else part.title()
                         for part in parts])
535927
private static String camelCaseToSentenceCase(String camelCase) {
        String name = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(camelCase), " ");
        return name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1)
                .toLowerCase(Locale.ENGLISH);
    }
1102638
def constants_from_value(data=@value)
      data.scan(escape_pattern).flatten.collect { |value| value.strip }
    end
430548
public static String camelCase(String prefix, String name) {
        return Strings.camelCase(prefix, name);
    }
1113533
def lower_camel_case_from_underscores(string):
    """"""
    components = string.split('_')
    string = components[0]
    for component in components[1:]:
        string += component[0].upper() + component[1:]
    return string