Android String Capitalize capitalize(String s)

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




Open Source License


public static String capitalize(String s) 

Method Source Code

//package com.java2s;
/*/*from w ww .  jav a2  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

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);


  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)