Java String Upper Case toUpperCaseNotation(String camelNotation)

Here you can find the source of toUpperCaseNotation(String camelNotation)

Description

to Upper Case Notation

License

Open Source License

Declaration

public static String toUpperCaseNotation(String camelNotation) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toUpperCaseNotation(String camelNotation) {
        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('_');
            }/*  ww w . j a v  a 2 s. c o m*/
            sb.append(Character.toUpperCase(c));
            change = Character.isUpperCase(c);
        }
        return sb.toString();
    }
}

Related

  1. toUppercaseHeadCharactor(String str)
  2. toUpperCaseIdent(String ident)
  3. toUpperCaseName(String s)
  4. toUpperCaseNamespace(String string)
  5. toUppercaseNoAccents(String txt)
  6. toUpperCaseOfFirstChar(String string)
  7. toUpperCaseUnderscore(String text)
  8. toUpperCaseWithUnderscores(String className)
  9. toUpperCaseWithUnderscores(String str)