Java String Upper Case toUpperCaseFirst(String str)

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

Description

to Upper Case First

License

Apache License

Declaration

public static String toUpperCaseFirst(String str) 

Method Source Code

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

public class Main {
    public static String toUpperCaseFirst(String str) {
        if (str == null)
            return null;
        if ("".equals(str))
            return str;
        String first = String.valueOf(str.charAt(0));
        str.replaceFirst(first, first.toUpperCase());
        return str;
    }//  w  ww.  j  a  v a2 s.co  m

    public static boolean equals(String str1, String str2) {
        if (str1 == null && str2 == null)
            return true;
        if (str1 != null && str1.equals(str2))
            return true;
        return false;
    }

    public static String toUpperCase(String str) {
        return str == null ? str : str.toUpperCase();
    }
}

Related

  1. toUppercaseAndUnderscore(String string)
  2. toUpperCaseArray(String[] source, String[] target)
  3. toUpperCaseAscii(String s)
  4. toUpperCaseAt(String oldString, int index)
  5. toUpperCaseAtFirstChar(String string)
  6. toUpperCaseFirst(String str)
  7. toUpperCaseFirst(String str)
  8. toUpperCaseFirst(String text)
  9. toUpperCaseFirst(String text)