Java String Lower Case toLowerCase(String string)

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

Description

to Lower Case

License

Open Source License

Declaration

public static String toLowerCase(String string) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011-2015 Red Hat, Inc.
 * Distributed under license by Red Hat, Inc. All rights reserved.
 * This program is made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://w w  w  .j a v  a  2 s .  c o m
 *     Red Hat, Inc. - initial API and implementation
 ******************************************************************************/

public class Main {
    public static String toLowerCase(String string) {
        if (isEmpty(string)) {
            return string;
        }

        return string.toLowerCase();
    }

    /** 
     * Returns true if value is null or empty string.
     * @param value
     * @return
     */
    public static boolean isEmpty(String value) {
        return value == null || value.length() == 0;
    }

    public static boolean isEmpty(Object value) {
        return (value instanceof String) && isEmpty((String) value);
    }
}

Related

  1. toLowerCase(String str)
  2. toLowerCase(String str)
  3. toLowerCase(String str)
  4. toLowerCase(String str)
  5. toLowerCase(String string)
  6. toLowerCase(String text)
  7. toLowerCase(String text)
  8. toLowerCase(String text)
  9. toLowerCase(String value)