Subversion Repositories eFlore/Applications.coel

Rev

Rev 798 | Rev 949 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.client.util;

public class UtilString {
        
        /**
         *  Mets la première lettre d'une chaine en majuscule
         *  
         *  @param chaineDeCaractere
         *  @result ChaineDeCaractere
         */
        
        public static String ucFirst(String inputStr)   {
                if (isEmpty(inputStr))  {
                        return "";
                }
                return inputStr.substring(0,1).toUpperCase() + inputStr.substring(1, inputStr.length());
        }
        
        public static boolean isEmpty(String inputStr)  {
                return inputStr == null || inputStr.equals("");
        }
        
        public static double formaterEnDouble(String nombre)    {
                if (!isEmpty(nombre)) {
                        return Double.parseDouble(nombre);
                }
                return new Double(0);
        }
}