Java String Capitalize First capitalizeFirst(String input)

Here you can find the source of capitalizeFirst(String input)

Description

capitalize First

License

Apache License

Declaration

public static String capitalizeFirst(String input) 

Method Source Code

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

public class Main {
    public static String capitalizeFirst(String input) {
        if (input == null)
            return null;
        if (input.length() < 2)
            return input.toUpperCase();
        return input.substring(0, 1).toUpperCase() + input.substring(1);
    }//w  ww .jav a 2s.c o m
}

Related

  1. capitaliseFirstLetter(String str)
  2. capitaliseFirstLetter(String text)
  3. capitalizedFirst(String str)
  4. capitalizedLetter(String str, boolean onlyFirst)
  5. capitalizeFirst(String attribute)
  6. capitalizeFirst(String name)
  7. capitalizeFirst(String rawStr)
  8. capitalizeFirst(String s)
  9. capitalizeFirst(String str)