Java String Decapitalize decapitalize(final String value)

Here you can find the source of decapitalize(final String value)

Description

decapitalize

License

Apache License

Declaration

public static String decapitalize(final String value) 

Method Source Code

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

public class Main {
    public static String decapitalize(final String value) {
        String result = "";
        boolean capitalize = false, isFirstLetter = true;

        for (final char c : value.toCharArray()) {
            final boolean isLetter = Character.isLetter(c);

            if (isLetter) {
                result += (!isFirstLetter && (capitalize || Character.isUpperCase(c))) ? Character.toUpperCase(c)
                        : Character.toLowerCase(c);

                if (isFirstLetter) {
                    isFirstLetter = false;
                }/*from www  . j  av  a2  s  . com*/
            }

            capitalize = !isLetter;
        }

        return result;
    }
}

Related

  1. decapitalize(final String s)
  2. decapitalize(final String string)
  3. decapitalize(String name)
  4. decapitalize(String name)
  5. decapitalize(String name)
  6. decapitalize(String name)