Java String Capitalize Full capitalizeFully(String to_capitalize)

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

Description

capitalize Fully

License

Open Source License

Declaration

public static String capitalizeFully(String to_capitalize) 

Method Source Code

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

public class Main {
    public static String capitalizeFully(String to_capitalize) {
        if (to_capitalize == null || to_capitalize.equals(""))
            return to_capitalize;
        else if (to_capitalize.length() == 1)
            return to_capitalize.toUpperCase();
        else/*from  w w w . j a  v a  2  s .  c o  m*/
            return to_capitalize.substring(0, 1).toUpperCase() + to_capitalize.substring(1).toLowerCase();
    }

    public static String substring(String string, String beginning, String end) {
        if (!string.contains(beginning) || !string.contains(end)
                || string.indexOf(beginning) >= string.indexOf(end))
            return null;
        else {
            String after_beginning = string.substring(string.indexOf(beginning) + beginning.length());
            return after_beginning.substring(0, after_beginning.indexOf(end));
        }
    }
}

Related

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