Android String Capitalize capitalize(String s)

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

Description

Capitalizes the first letter in the string s

Parameter

Parameter Description
s The string to manipulate

Return

A string with the first letter capitalized

Declaration

public static String capitalize(String s) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w ww  .j a va  2  s. c  o  m*/
     * Capitalizes the first letter in the string s
     * @param s The string to manipulate
     * @return A string with the first letter capitalized
     */
    public static String capitalize(String s) {
        return Character.toUpperCase(s.charAt(0)) + s.substring(1);
    }
}

Related

  1. capitalizeFirstLetter(String src)
  2. capitalize(String s)
  3. capitalize(String str)
  4. capitalizeFirst(String i, Locale l)
  5. capitalize(String str)
  6. capitalize(final String name)
  7. decapitalize(final String name)
  8. capitalize(String string)
  9. decapitalize(String string)