Java String Capitalize capitalize(final String value)

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

Description

capitalize

License

Apache License

Declaration

public static String capitalize(final String value) 

Method Source Code

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

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

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

            if (isLetter) {
                result += (capitalize || Character.isUpperCase(c)) ? Character.toUpperCase(c)
                        : Character.toLowerCase(c);
            }//from   w  ww . j a va  2 s . c o m

            capitalize = !isLetter;
        }

        return result;
    }
}

Related

  1. capitalize(final String str, final char... delimiters)
  2. capitalize(final String text)
  3. capitalize(final String value)
  4. capitalize(final String value)
  5. capitalize(final String value)
  6. capitalize(final String word)
  7. capitalize(String capitalizeMe)
  8. capitalize(String constraint)
  9. capitalize(String content)