Android String Case Convert uncapitalize(String capitalizedMessage, char letter)

Here you can find the source of uncapitalize(String capitalizedMessage, char letter)

Description

Replace all occurrences of letter in capitalizedMessage with toLowerCase(letter)

Parameter

Parameter Description
capitalizedMessage a parameter
letter a parameter

Return

capitalizedMessage with all occurrences of letter in lower-case.

Declaration

public static String uncapitalize(String capitalizedMessage, char letter) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  w  w  w. j ava2s .  c o m
     * Replace all occurrences of letter in capitalizedMessage with toLowerCase(letter)
     * @param capitalizedMessage
     * @param letter
     * @return capitalizedMessage with all occurrences of letter in lower-case.
     */
    public static String uncapitalize(String capitalizedMessage, char letter) {

        StringBuffer message = new StringBuffer(capitalizedMessage);

        for (int i = 0; i < message.length(); i++) {
            char c = message.charAt(i);
            if (Character.isLetter(c)) {
                if (Character.toLowerCase(c) == Character
                        .toLowerCase(letter)) {
                    message.setCharAt(i, Character.toLowerCase(c));
                }
            }
        }

        return message.toString();
    }
}

Related

  1. startsWithIgnoreCase(final String target1, final String target2)
  2. toTitleCase(String s)
  3. camelString(String str, boolean firstCharacterUppercase)
  4. firstByteToLower(String instring)
  5. capitalize(String plainMessage, char letter)
  6. toUpper(char ch)
  7. toLowerSubset(String source, char substitute)
  8. UpperCase(String str)
  9. capitalize(String s)