Here you can find the source of capitalise(String s)
Parameter | Description |
---|---|
s | Describe what the parameter does |
public static String capitalise(String s)
//package com.java2s; public class Main { /**/*from w w w .j a v a 2 s. c o m*/ * Describe what the method does * * @todo-javadoc Write javadocs for method * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for return value * @param s Describe what the parameter does * @return Describe the return value */ public static String capitalise(String s) { if (s.equals("")) { return ""; } if (s.length() == 1) { return s.toUpperCase(); } else { String caps = s.substring(0, 1).toUpperCase(); String rest = s.substring(1); return caps + rest; } } /** * Describe what the method does * * @todo-javadoc Write javadocs for method * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for method parameter * @todo-javadoc Write javadocs for return value * @param a Describe what the parameter does * @param b Describe what the parameter does * @return Describe the return value */ public static boolean equals(Object a, Object b) { if (a == null && b == null) { return true; } if (a != null && a.equals(b)) { return true; } return false; } }