List of usage examples for org.apache.commons.lang StringUtils upperCase
public static String upperCase(String str)
Converts a String to upper case as per String#toUpperCase() .
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; }