Example usage for org.apache.commons.lang StringUtils upperCase

List of usage examples for org.apache.commons.lang StringUtils upperCase

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils upperCase.

Prototype

public static String upperCase(String str) 

Source Link

Document

Converts a String to upper case as per String#toUpperCase() .

Usage

From source file:utils.Utilitaires.java

public static String codeInscription(Etablissement etablissement, Annee annee) {
    String resultat = "";
    try {/*from  ww w .  j a  v a2 s . com*/
        String[] chaines = etablissement.getNom().split(" ");
        int i = 0;
        for (String s : chaines) {
            if (i == 1) {
                if (!StringUtils.upperCase(s).startsWith(StringUtils.upperCase("d"))) {
                    resultat += s.toUpperCase().charAt(0);
                }
            } else {
                resultat += s.toUpperCase().charAt(0);
            }
            i++;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return resultat;
}