Here you can find the source of uncapitalize(String capitalizedMessage, char letter)
Parameter | Description |
---|---|
capitalizedMessage | a parameter |
letter | a parameter |
public static String uncapitalize(String capitalizedMessage, char letter)
//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(); } }