Java String Capitalize First capitalizeFirstLetter(String str)

Here you can find the source of capitalizeFirstLetter(String str)

Description

capitalize First Letter

License

Apache License

Declaration

public static String capitalizeFirstLetter(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String capitalizeFirstLetter(String str) {
        return (isEmpty(str) || !Character.isLetter(str.charAt(0))) ? str
                : Character.toUpperCase(str.charAt(0)) + str.substring(1);
    }//from ww w.  ja v a2 s  .  c om

    public static boolean isEmpty(String str) {
        return (str == null || str.length() == 0);
    }
}

Related

  1. capitalizeFirstLetter(String str)
  2. capitalizeFirstLetter(String str)
  3. capitalizeFirstLetter(String str)
  4. capitalizeFirstLetter(String str)
  5. capitalizeFirstLetter(String str)
  6. capitalizeFirstLetter(String str)
  7. capitalizeFirstLetter(String string)
  8. capitalizeFirstLetter(String string)
  9. capitalizeFirstLetter(String text)