Android String Case Convert capitalize(final String str)

Here you can find the source of capitalize(final String str)

Description

capitalize

Declaration

public static String capitalize(final String str) 

Method Source Code

//package com.java2s;

public class Main {
    public static String capitalize(final String str) {
        final char[] buffer = str.toCharArray();
        boolean capitalizeNext = true;
        for (int i = 0; i < buffer.length; i++) {
            final char ch = buffer[i];
            if (capitalizeNext) {
                buffer[i] = Character.toTitleCase(ch);
                capitalizeNext = false;//  w  w  w .j  a  va  2 s  . c  o  m
            }
        }
        return new String(buffer);
    }
}

Related

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