Android String Case Convert capitalize(String s)

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

Description

capitalize

Declaration

private static String capitalize(String s) 

Method Source Code

//package com.java2s;

public class Main {
    private static String capitalize(String s) {
        if (s == null || s.length() == 0) {
            return "";
        }/* w  w w . ja  v a  2 s . com*/
        char first = s.charAt(0);
        if (Character.isUpperCase(first)) {
            return s;
        } else {
            return Character.toUpperCase(first) + s.substring(1);
        }
    }
}

Related

  1. capitalize(String plainMessage, char letter)
  2. uncapitalize(String capitalizedMessage, char letter)
  3. toUpper(char ch)
  4. toLowerSubset(String source, char substitute)
  5. UpperCase(String str)
  6. capitalize(final String str)
  7. capitalizeFirst(CharSequence movementTitle)