Java String Capitalize First capitalizeFirstLetter(final String s)

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

Description

capitalize First Letter

License

Open Source License

Declaration

public static String capitalizeFirstLetter(final String s) 

Method Source Code

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

public class Main {
    public static String capitalizeFirstLetter(final String s) {
        final char[] first = s.toCharArray();
        if (Character.isLetter(first[0])) {
            first[0] = Character.toUpperCase(first[0]);
            return new String(first);
        }/*from w  w  w  .j a v  a2 s .  c o m*/
        return s;
    }
}

Related

  1. capitalizeFirstCharacterString(String item)
  2. capitalizeFirstCharOfString(final String input)
  3. capitalizeFirstLeter(String sentence)
  4. capitalizeFirstLetter(final CharSequence chars)
  5. capitalizeFirstLetter(final String aString)
  6. capitalizeFirstLetter(final String variableName)
  7. capitalizeFirstLetter(String data)
  8. capitalizeFirstLetter(String data)
  9. capitalizeFirstLetter(String data)