Java String Capitalize Full capitalizeFully(String string)

Here you can find the source of capitalizeFully(String string)

Description

capitalize Fully

License

Apache License

Declaration

public static String capitalizeFully(String string) 

Method Source Code

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

public class Main {
    public static String capitalizeFully(String string) {
        if (string.length() == 0) {
            return string;
        }/*from  w  w  w .j  a v  a2 s.  c o m*/
        if (string.length() == 1) {
            return string.toUpperCase();
        }
        return string.substring(0, 1).toUpperCase() + string.substring(1).toLowerCase();
    }
}

Related

  1. capitalizeFully(String str)
  2. capitalizeFully(String str)
  3. capitalizeFully(String str)
  4. capitalizeFully(String str, final char... delimiters)
  5. capitalizeFully(String str, final char... delimiters)
  6. capitalizeFully(String text)
  7. capitalizeFully(String to_capitalize)