Android String Capitalize capitalize(String s)

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

Description

capitalize

License

Open Source License

Declaration

public static String capitalize(String s) 

Method Source Code

//package com.java2s;
/*/*from w ww .  jav a2 s.co  m*/
 * Copyright (c) 2014 Denis Solonenko.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

public class Main {
    public static String capitalize(String s) {
        if (s == null || s.length() == 0)
            return s;
        char[] stringArray = s.toCharArray();
        stringArray[0] = Character.toUpperCase(stringArray[0]);
        return new String(stringArray);
    }
}

Related

  1. capitalizeFirstLetter(String word)
  2. capitalize(String s)
  3. capitalize(String str)
  4. uncapitalize(String str)
  5. capitalizeFirstLetter(String src)
  6. capitalize(String s)
  7. capitalize(String str)
  8. capitalizeFirst(String i, Locale l)