Java String Decapitalize decapitalize(String str)

Here you can find the source of decapitalize(String str)

Description

decapitalize

License

Apache License

Declaration

public static String decapitalize(String str) 

Method Source Code

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

public class Main {
    public static String decapitalize(String str) {
        if (isEmpty(str))
            return str;

        char cs[] = str.toCharArray();
        if (cs.length >= 2 && Character.isUpperCase(cs[0]) && Character.isUpperCase(cs[1]))
            return str;

        cs[0] = Character.toLowerCase(cs[0]);
        return new String(cs);
    }/*from   w w  w. ja v a  2 s  .  co  m*/

    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }
}

Related

  1. decapitalize(String name)
  2. deCapitalize(String noun)
  3. decapitalize(String s)
  4. decapitalize(String s)
  5. decapitalize(String st)
  6. decapitalize(String string)
  7. decapitalize(String string)
  8. decapitalize(String string)
  9. decapitalize(String string)