Java Utililty Methods String Lower Case

List of utility methods to do String Lower Case

Description

The list of methods to do String Lower Case are organized into topic(s).

Method

StringtoLowerCase(String text)
to upper case like xxx_xxx_xxx
if (text != null && text.length() > 0) {
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < text.length(); i++) {
        char c = text.charAt(i);
        if (i != 0 && Character.isUpperCase(c)) {
            sb.append("_");
        sb.append(Character.toLowerCase(c));
...
StringtoLowerCase(String text)
to Lower Case
if (null != text) {
    return text.toLowerCase();
return text;
StringtoLowerCase(String value)

Converts the given value to lower case.

if (value == null) {
    return null;
return value.trim().toLowerCase();
StringtoLowerCase(String value)
to Lower Case
return value != null ? value.toLowerCase() : value;
String[]toLowerCase(String[] strArr)
to Lower Case
if (strArr == null)
    return null;
String[] res = new String[strArr.length];
for (int i = 0; i < strArr.length; i++) {
    res[i] = strArr[i].toLowerCase();
return res;
StringBuffertoLowerCase(StringBuffer buf)
to Lower Case
int len = buf.length();
for (int i = 0; i < len; i++) {
    char lc = buf.charAt(i);
    char uc = Character.toLowerCase(lc);
    if (lc != uc) {
        buf.setCharAt(i, uc);
return buf;
voidtoLowerCase(StringBuffer buffer)
Puts all chars in the buffer in lower case.
final int N = buffer.length();
for (int i = 0; i < N; i++) {
    char c = buffer.charAt(i);
    if (Character.isUpperCase(c)) {
        c = Character.toLowerCase(c);
        buffer.setCharAt(i, c);
StringtoLowerCase0(String string)
to Lower Case
return Character.toLowerCase(string.charAt(0)) + string.substring(1);
StringtoLowerCaseAscii(String s)
Returns a string with all ASCII upper-case letters converted to lower-case.
if (s == null)
    return null;
int len = s.length();
char c = 0;
boolean hasUpperCase = false;
for (int i = 0; i < len; i++) {
    c = s.charAt(i);
    if (c >= 'A' && c <= 'Z') {
...
StringtoLowerCaseFirst(String str)
to Lower Case First
if (str == null)
    return null;
if ("".equals(str))
    return str;
String first = String.valueOf(str.charAt(0));
str.replaceFirst(first, first.toLowerCase());
return str;