Here you can find the source of capitalize(final String s)
Parameter | Description |
---|---|
s | <code>String</code> The property name |
String
given String with 1st letter capitalized
public static String capitalize(final String s)
//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; } }