Java String Capitalize First capitalizeFirstChar(String name)

Here you can find the source of capitalizeFirstChar(String name)

Description

capitalize First Char

License

Open Source License

Declaration

public static String capitalizeFirstChar(String name) 

Method Source Code

//package com.java2s;

public class Main {
    public static String capitalizeFirstChar(String name) {
        if (name == null || name.length() == 0) {
            return name;
        }/*  w w w  . j  a  va  2s . c  om*/
        if (name.startsWith("_")) {
            return capitalizeFirstChar(name.substring(1));
        }
        char chars[] = name.toCharArray();
        chars[0] = Character.toUpperCase(chars[0]);
        return new String(chars);
    }
}

Related

  1. capitalizeFirst(String string)
  2. capitalizeFirst(String string)
  3. capitalizeFirst(String toCap)
  4. capitalizeFirst(String toCapitalize)
  5. capitalizeFirstChar(final String str)
  6. capitalizeFirstChar(String name)
  7. capitalizeFirstChar(String s)
  8. capitalizeFirstCharacter(final String s)
  9. capitalizeFirstCharacter(String s)