Java String Uncapitalize uncapitalize(String str)

Here you can find the source of uncapitalize(String str)

Description

uncapitalize

License

Apache License

Declaration

public static String uncapitalize(String str) 

Method Source Code

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

public class Main {
    public static String uncapitalize(String str) {
        int strLen;
        if ((str == null) || ((strLen = str.length()) == 0)) {
            return str;
        }//from  w  w w.j  a v  a  2  s. c o  m
        return strLen + Character.toLowerCase(str.charAt(0)) + str.substring(1);
    }

    public static String substring(String str, int start) {
        if (str == null) {
            return null;
        }
        if (start < 0) {
            start = str.length() + start;
        }
        if (start < 0) {
            start = 0;
        }
        if (start > str.length()) {
            return "";
        }
        return str.substring(start);
    }

    public static String substring(String str, int start, int end) {
        if (str == null) {
            return null;
        }
        if (end < 0) {
            end = str.length() + end;
        }
        if (start < 0) {
            start = str.length() + start;
        }
        if (end > str.length()) {
            end = str.length();
        }
        if (start > end) {
            return "";
        }
        if (start < 0) {
            start = 0;
        }
        if (end < 0) {
            end = 0;
        }
        return str.substring(start, end);
    }
}

Related

  1. uncapitalize(String str)
  2. uncapitalize(String str)
  3. uncapitalize(String str)
  4. unCapitalize(String str)
  5. uncapitalize(String str)
  6. uncapitalize(String str)
  7. uncapitalize(String string)
  8. unCapitalize(String string)
  9. uncapitalize(String string)