Format a prefixed name as camelCase. The prefix is kept verbatim, while
tha name is split on '_' chars, and joined with each part capitalized.

@param prefix Name prefix, not modified.
@param name   The name to camel-case.
@return theCamelCasedName
430548
public static String camelCase(String prefix, String name) {
        return Strings.camelCase(prefix, name);
    }
850928
def _prepend_name_prefix(self, name):
        """"""
        if not self.name_prefix:
            return name
        base = self.name_prefix
        if base[0] != '/':
            base = '/' + base
        if name[0] != '/':
            name = '/' + name
        return base + name
972642
public static boolean startsWithIgnoreCase(String input, String prefix) {
        if (input == null || prefix == null || prefix.length() > input.length()) {
            return false;
        } else {
            final char[] inputCharArray = input.toCharArray();
            final char[] prefixCharArray = prefix.toCharArray();
            for (int i = 0; i < prefixCharArray.length; i++) {
                if (!equalsIgnoreCase(prefixCharArray[i], inputCharArray[i])) {
                    return false;
                }
            }
            return true;
        }
    }
218112
def extract_prefix(name)
      return unless name && name.size > 1 && @prefix.nil? && @first.nil?
      Nameable::Latin::Patterns::PREFIX.each do |pretty, regex|
        next unless name.first =~ regex
        @prefix = pretty
        name.delete(name.first)
        break
      end
    end
501679
public function _prefix($name, $prefix)
    {
        list($alias, $field) = $this->undot($name);
        return $alias ? $name : "{$prefix}.{$field}";
    }
572309
public static String getCamelName(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        name = name.toLowerCase();
        //去掉前面的_
        while (name.startsWith("_")) {
            name = name.substring(1);
        }
        //去掉后面的_
        while (name.endsWith("_")) {
            name = name.substring(0, name.length() - 1);
        }

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < name.length(); i++) {

            char c = name.charAt(i);

            if (c == '_') {
                i++;
                sb.append(Character.toUpperCase(name.charAt(i)));
                continue;
            }
            sb.append(c);
        }

        return sb.toString();
    }
413108
public static String createRandomName(String prefix) {
		Preconditions.checkNotNull(prefix, "Prefix must not be null.");

		long nameOffset;

		// obtain the next name offset by incrementing it atomically
		do {
			nameOffset = nextNameOffset.get();
		} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L));

		return prefix + '_' + nameOffset;
	}
953841
public static String convertUnderscoreNameToClassName(String name) {
        StringBuffer result = new StringBuffer();
        boolean nextIsUpper = false;

        if (name != null) {
            int len = name.length();

            if (len > 0) {
                String s = String.valueOf(name.charAt(0));

                result.append(s.toUpperCase());

                for (int i = 1; i < len; i++) {
                    s = String.valueOf(name.charAt(i));

                    if ("_".equals(s)) {
                        nextIsUpper = true;
                    } else {
                        if (nextIsUpper) {
                            result.append(s.toUpperCase());
                            nextIsUpper = false;
                        } else {
                            result.append(s.toLowerCase());
                        }
                    }
                }
            }
        }

        return result.toString();
    }
32477
public static String convertClassNameToUnderscoreName(String name) {
        StringBuilder result = new StringBuilder();

        if (name != null) {
            int len = name.length();

            if (len > 0) {
                result.append(name.charAt(0));

                for (int i = 1; i < len; i++) {
                    if (true == Character.isUpperCase(name.charAt(i))) {
                        result.append('_');
                    }

                    result.append(name.charAt(i));
                }
            }
        }

        return result.toString().toUpperCase();
    }
812944
public String fullyQualifiedSymbolName(String name) {
        if (name.equals(SymbolsTable.ME)) {
            return "$".concat(id());
        } else if (name.startsWith("$")) {
            return "$" + id() + '.' + name.substring(1);
        }
        return id() + '.' + name;
    }
218984
public static String macroCase(String name) {
        return Strings.c_case(name).toUpperCase(Locale.US);
    }
1215750
public String toFirstUpper(String name) {
		if (name.length() == 0) {
			return name;
		} else {
			return name.substring(0, 1).toUpperCase() + name.substring(1);
		}
	}
108404
public function prefix($name)
    {
        if ($prefix = $this->config()->attribute['prefix']) {
            
            if (strpos($name, $prefix) !== 0) {
                return sprintf('%s%s', $prefix, $name);
            }
            
        }
        
        return $name;
    }
1189126
public static String unStudlyName (String name)
    {
        boolean seenLower = false;
        StringBuilder nname = new StringBuilder();
        int nlen = name.length();
        for (int i = 0; i < nlen; i++) {
            char c = name.charAt(i);
            // if we see an upper case character and we've seen a lower case character since the
            // last time we did so, slip in an _
            if (Character.isUpperCase(c)) {
                if (seenLower) {
                    nname.append("_");
                }
                seenLower = false;
                nname.append(c);
            } else {
                seenLower = true;
                nname.append(Character.toUpperCase(c));
            }
        }
        return nname.toString();
    }
471629
public static String fixName(String name) {
        if (name == null) {
            throw MESSAGES.nullArgument("name");
        }
        int length = name.length();
        if (length <= 1) { return name; }
        if (name.charAt(length - 1) == '/') { return name.substring(0, length - 1); }
        return name;
    }
818786
private String getAndAddUniqueShortName(String name) {
        // Capitalize the first letter of the name.
        String initCappedName = name.substring(0, 1).toUpperCase() + name.substring(1, name.length());
        // Make the short name all the capital letters in the long name.
        Matcher matcher = capitals.matcher(initCappedName);
        StringBuilder sbShortName = new StringBuilder();
        while(matcher.find()) {
            sbShortName.append(matcher.group());
        }
        String shortName = sbShortName.toString().toLowerCase();

        if (!shortNames.add(shortName)) {
            int i;
            for (i=0; i<10; i++) {
                String tmpsn = shortName + i;
                if (shortNames.add(tmpsn)) {
                    shortName = tmpsn;
                    break;
                }
            }
            if (i == 10) {
                throw new RuntimeException("Multiple options have the same short name: -" + shortName  + " (--" + name + ")");
            }
        }
        return shortName;
    }
415432
private String[] underscoreName(String camelCaseName) {
        StringBuilder result = new StringBuilder();
        if (camelCaseName != null && camelCaseName.length() > 0) {
            result.append(camelCaseName.substring(0, 1).toLowerCase());
            for (int i = 1; i < camelCaseName.length(); i++) {
                char ch = camelCaseName.charAt(i);
                if (Character.isUpperCase(ch)) {
                    result.append("_");
                    result.append(Character.toLowerCase(ch));
                } else {
                    result.append(ch);
                }
            }
        }
        String name = result.toString();
        // 当name为user1_name2时，使name2为user_1_name_2
        // 这使得列user_1_name_2的列能映射到user1Name2属性
        String name2 = null;
        boolean digitFound = false;
        for (int i = name.length() - 1; i >= 0; i--) {
            if (Character.isDigit(name.charAt(i))) {
            	// 遇到数字就做一个标识并continue,直到不是时才不continue
                digitFound = true;
                continue;
            }
            // 只有上一个字符是数字才做下划线
            if (digitFound && i < name.length() - 1 && i > 0) {
                if (name2 == null) {
                    name2 = name;
                }
                name2 = name2.substring(0, i + 1) + "_" + name2.substring(i + 1);
            }
            digitFound = false;
        }
        return new String[] { name, name2 };
    }