Here you can find the source of capitalizeAt(StringBuilder builder, int index)
Parameter | Description |
---|---|
builder | StringBuilder |
index | position of character to be capitalized. |
public static void capitalizeAt(StringBuilder builder, int index)
//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); } } }