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) {
        char[] chars = str.toCharArray();

        if ((chars[0] >= 97 && chars[0] <= 122)) {
            chars[0] -= 32;/*from  ww w .  j  a v  a  2 s  . c  o m*/
        }

        return String.valueOf(chars);
    }
}

Related

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