Java String Capitalize capitalizeAt(StringBuilder builder, int index)

Here you can find the source of capitalizeAt(StringBuilder builder, int index)

Description

Capitalize character at index.

License

Open Source License

Parameter

Parameter Description
builder StringBuilder
index position of character to be capitalized.

Declaration

public static void capitalizeAt(StringBuilder builder, int index) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  ww w  .j a va2  s.c o m
     * Capitalize character at index.
     * 
     * @param builder {@link StringBuilder}
     * @param index position of character to be capitalized.
     */
    public static void capitalizeAt(StringBuilder builder, int index) {
        char c = builder.charAt(index);
        char capitalized = Character.toUpperCase(c);
        if (c != capitalized) {
            builder.setCharAt(index, capitalized);
        }
    }
}

Related

  1. capitalize(String word)
  2. capitalize(String word)
  3. capitalize(String word)
  4. capitalize(String words)
  5. capitalize(StringBuilder text)
  6. capitalizeClass(String className)
  7. capitalized(String s)
  8. capitalized(String s)
  9. capitalized(String str)