Here you can find the source of capitalise(String s)
Parameter | Description |
---|---|
s | the string. |
public static String capitalise(String s)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w .j ava2s . c om*/ * Change the first letter of a string to upper case. * * @param s the string. * @return the string, with the first letter changed to upper case. */ public static String capitalise(String s) { return s.isEmpty() ? s : s.charAt(0) + s.substring(1); } }