Java String Lower Case toLowerCase(String value)

Here you can find the source of toLowerCase(String value)

Description

Converts the given value to lower case.

License

Apache License

Parameter

Parameter Description
value The string value, may be null.

Return

the given value converted to lower case or null .

Declaration

public static String toLowerCase(String value) 

Method Source Code

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

public class Main {
    /**//from  w ww  .  ja v a  2  s.c  o m
     * <p>
     * Converts the given value to lower case.
     * </p>
     * <p/>
     * <pre>
     * toLowerCase(null)    = null
     * toLowerCase("")      = ""
     * toLowerCase("aBc")   = "abc"
     * toLowerCase("abc")   = "abc"
     * toLowerCase(" ABC ") = "abc"
     * </pre>
     *
     * @param value
     *         The string value, may be null.
     * @return the given {@code value} converted to lower case or {@code null}.
     */
    public static String toLowerCase(String value) {
        if (value == null) {
            return null;
        }

        return value.trim().toLowerCase();
    }

    /**
     * Trims the given {@code value}.
     *
     * @param value
     *         The value to trim.
     * @return the given {@code value} trimmed or {@code null}.
     */
    public static String trim(String value) {
        if (value == null) {
            return null;
        }
        return value.trim();
    }
}

Related

  1. toLowerCase(String string)
  2. toLowerCase(String string)
  3. toLowerCase(String text)
  4. toLowerCase(String text)
  5. toLowerCase(String text)
  6. toLowerCase(String value)
  7. toLowerCase(String[] strArr)
  8. toLowerCase(StringBuffer buf)
  9. toLowerCase(StringBuffer buffer)