Here you can find the source of toLowerCase(StringBuffer buffer)
Parameter | Description |
---|---|
buffer | to be put into lower case |
public static void toLowerCase(StringBuffer buffer)
//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); } } } }