Here you can find the source of capitalise(final String name)
public static String capitalise(final String name)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file public class Main { public static String capitalise(final String name) { String s = name;//from ww w . j a va 2 s.c o m switch (s.length()) { case 0: { break; } case 1: { s = name.toUpperCase(); break; } default: { s = name.substring(0, 1).toUpperCase() + name.substring(1); break; } } return s; } }