returns the string, the first char lowercase - Android java.lang

Android examples for java.lang:String Case

Description

returns the string, the first char lowercase

Demo Code

import android.location.Location;
import java.math.BigDecimal;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main{

    /**/* w w w  . j  a v  a 2 s .  co  m*/
     * returns the string, the first char lowercase
     *
     * @param target
     * @return
     */
    public final static String asLowerCaseFirstChar(final String target) {

        if ((target == null) || (target.length() == 0)) {
            return target; // You could omit this check and simply live with an
                           // exception if you like
        }
        return Character.toLowerCase(target.charAt(0))
                + (target.length() > 1 ? target.substring(1) : "");
    }

}

Related Tutorials