Java String Upper Case toUpperCase(String string)

Here you can find the source of toUpperCase(String string)

Description

Makes sure that the first character in a string is upper case.

License

Open Source License

Parameter

Parameter Description

Return

String: A new String which has the upper case correction applied to it.

Declaration

public static String toUpperCase(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**// w  w w. j  a v a 2 s.com
     * Makes sure that the first character in a string is upper case. This is useful when presenting data
     * taken directly from the jvm or another source which may not have nice data.
     * 
     * @param string: The string being corrected.
     * @return String: A new String which has the upper case correction applied to it.
     */
    public static String toUpperCase(String string) {

        return Character.toString(string.charAt(0)).toUpperCase() + string.substring(1);
    }
}

Related

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