Java String Capitalize capitalize(final String s)

Here you can find the source of capitalize(final String s)

Description

Return a capitalized version of the specified property name.

License

Open Source License

Parameter

Parameter Description
s <code>String</code> The property name

Return

String given String with 1st letter capitalized

Declaration

public static String capitalize(final String s) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w  w w .j  a va 2  s  . c o  m*/
     * Return a capitalized version of the specified property name.
     *
     * @param s <code>String</code> The property name
     * @return <code>String</code> given String with 1st letter capitalized
     */
    public static String capitalize(final String s) {
        String cs = null;
        if (s != null && 0 < s.length()) {
            final char[] chars = s.toCharArray();
            chars[0] = Character.toUpperCase(chars[0]);
            cs = new String(chars);
        }
        return cs;
    }
}

Related

  1. capitalize(final String docName)
  2. capitalize(final String input)
  3. capitalize(final String name)
  4. capitalize(final String s)
  5. capitalize(final String s)
  6. capitalize(final String s)
  7. capitalize(final String s)
  8. capitalize(final String s)
  9. capitalize(final String str)