Java String Upper Case toUpperCaseName(String s)

Here you can find the source of toUpperCaseName(String s)

Description

to Upper Case Name

License

Open Source License

Declaration

public static String toUpperCaseName(String s) 

Method Source Code

//package com.java2s;
//    it under the terms of the GNU General Public License as published by

public class Main {

    public static String toUpperCaseName(String s) {
        String res;/*from ww  w.j a v a 2s  . c  o  m*/
        res = s.replaceAll("\\s*&\\s*|\\s* \\s*", "-");
        res = res.replaceAll("\\s*\\W+\\s*|\\s+", "-");
        res = res.replaceAll("^-+|-+$", "");
        return res.toUpperCase();
    }
}

Related

  1. toUpperCaseFirstOne(String origin)
  2. toUpperCaseFirstOne(String s)
  3. toUpperCaseHead(String str)
  4. toUppercaseHeadCharactor(String str)
  5. toUpperCaseIdent(String ident)
  6. toUpperCaseNamespace(String string)
  7. toUppercaseNoAccents(String txt)
  8. toUpperCaseNotation(String camelNotation)
  9. toUpperCaseOfFirstChar(String string)