Java String Lower Case toLowerCase(StringBuffer buffer)

Here you can find the source of toLowerCase(StringBuffer buffer)

Description

Puts all chars in the buffer in lower case.

License

Open Source License

Parameter

Parameter Description
buffer to be put into lower case

Declaration

public static void toLowerCase(StringBuffer buffer) 

Method Source Code

//package com.java2s;
/*  Copyright 2011 Alexander Bunkenburg alex@inspiracio.com
    /*w  w w. ja va  2  s.  co m*/
This file is part of atom.jar.
    
atom.jar is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
atom.jar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with atom.jar.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    /** Puts all chars in the buffer in lower case.
     * Does not allocate Strings, does not change the size of the
     * buffer.
     * @param buffer to be put into lower case */
    public static void toLowerCase(StringBuffer buffer) {
        final int N = buffer.length();
        for (int i = 0; i < N; i++) {
            char c = buffer.charAt(i);
            if (Character.isUpperCase(c)) {
                c = Character.toLowerCase(c);
                buffer.setCharAt(i, c);
            }
        }
    }
}

Related

  1. toLowerCase(String text)
  2. toLowerCase(String value)
  3. toLowerCase(String value)
  4. toLowerCase(String[] strArr)
  5. toLowerCase(StringBuffer buf)
  6. toLowerCase0(String string)
  7. toLowerCaseAscii(String s)
  8. toLowerCaseFirst(String str)
  9. toLowerCaseFirst(String str)