Java Utililty Methods String Upper Case

List of utility methods to do String Upper Case

Description

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

Method

StringtoUpperCaseFirstOne(String origin)
to Upper Case First One
StringBuffer sb = new StringBuffer(origin);
sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
sb.insert(0, "get");
return sb.toString();
StringtoUpperCaseFirstOne(String s)
to Upper Case First One
if (Character.isUpperCase(s.charAt(0)))
    return s;
else
    return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1))
            .toString();
StringtoUpperCaseHead(String str)
to Upper Case Head
if (str.length() == 0)
    return str;
return str.substring(0, 1).toUpperCase() + str.substring(1);
StringtoUppercaseHeadCharactor(String str)
to Uppercase Head Charactor
StringBuffer sb = new StringBuffer();
sb.append(str.substring(0, 1).toUpperCase());
sb.append(str.substring(1).toLowerCase());
return sb.toString();
StringtoUpperCaseIdent(String ident)
to Upper Case Ident
return Character.toUpperCase(ident.charAt(0)) + ident.substring(1);
StringtoUpperCaseName(String s)
to Upper Case Name
String res;
res = s.replaceAll("\\s*&\\s*|\\s* \\s*", "-");
res = res.replaceAll("\\s*\\W+\\s*|\\s+", "-");
res = res.replaceAll("^-+|-+$", "");
return res.toUpperCase();
StringtoUpperCaseNamespace(String string)
to Upper Case Namespace
String[] path = string.split("[.]");
String type = "";
for (int i = 0; i < path.length; i++) {
    if (i != path.length - 1) {
        if (path[i].equals("loopheader"))
            path[i] = "loopHeader";
        else if (path[i].equals("completionevents"))
            path[i] = "completionEvents";
...
StringtoUppercaseNoAccents(String txt)
to Uppercase No Accents
if (txt == null) {
    return null;
String txtUpper = txt.toUpperCase();
StringBuilder sb = new StringBuilder();
int n = txtUpper.length();
for (int i = 0; i < n; i++) {
    char c = txtUpper.charAt(i);
...
StringtoUpperCaseNotation(String camelNotation)
to Upper Case Notation
StringBuilder sb = new StringBuilder(camelNotation.length() + 10);
boolean change = true;
for (int i = 0; i < camelNotation.length(); i++) {
    char c = camelNotation.charAt(i);
    change = !change && Character.isUpperCase(c);
    if (change) {
        sb.append('_');
    sb.append(Character.toUpperCase(c));
    change = Character.isUpperCase(c);
return sb.toString();
StringtoUpperCaseOfFirstChar(String string)
to Upper Case Of First Char
if (string == null || string.trim().equals("")) {
    return "";
} else {
    string = string.trim();
    String firstChar = string.substring(0, 1).toUpperCase();
    string = firstChar + string.substring(1);
return string;
...