Java String Lower Case toLowerCase(String s)

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

Description

Locale-independent variant of String#toLowerCase() .

License

Open Source License

Declaration

public static String toLowerCase(String s) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

public class Main {
    /**//w  w w .j  a v a  2  s  .com
     * Locale-independent variant of {@link String#toLowerCase()}.
     * This method works on {@code char} level and hence uses a locale-independent
     * character mapping as defined by the Unicode standard.
     */
    public static String toLowerCase(String s) {
        StringBuilder sb = new StringBuilder(s);
        for (int i = 0, len = sb.length(); i < len; i++) {
            char ch = sb.charAt(i);
            char ch2 = Character.toLowerCase(ch);
            if (ch != ch2)
                sb.setCharAt(i, ch2);
        }
        return sb.toString();
    }
}

Related

  1. toLowerCase(String input)
  2. toLowerCase(String input)
  3. toLowerCase(String name)
  4. toLowerCase(String pString)
  5. toLowerCase(String s)
  6. toLowerCase(String s)
  7. toLowerCase(String s, int start, int end)
  8. toLowerCase(String source)
  9. toLowerCase(String str)