Java String Capitalize First capitalizeFirstLetter(String s)

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

Description

capitalize First Letter

License

LGPL

Declaration

public static String capitalizeFirstLetter(String s) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String capitalizeFirstLetter(String s) {
        return s.substring(0, 1).toUpperCase() + s.substring(1);
    }/*from  w  w w.  ja v  a2s  .  c o m*/

    public static String substring(String S, int beginIndex, int endIndex) {
        if (beginIndex < endIndex && beginIndex >= 0 && endIndex <= S.length()) {
            return S.substring(beginIndex, endIndex);
        } else {
            return "";
        }
    }

    public static String substring(String S, int beginIndex) {
        return substring(S, beginIndex, S.length());
    }
}

Related

  1. capitalizeFirstLetter(String message)
  2. CapitalizeFirstLetter(String name)
  3. capitalizeFirstLetter(String s)
  4. capitalizeFirstLetter(String s)
  5. capitalizeFirstLetter(String s)
  6. capitalizeFirstLetter(String s)
  7. capitalizeFirstLetter(String str)
  8. capitalizeFirstLetter(String str)
  9. capitalizeFirstLetter(String str)