Here you can find the source of toCamelCase(String str)
Parameter | Description |
---|---|
str | the input string |
public static String toCamelCase(String str)
//package com.java2s; public class Main { /**/*from www. j av a 2 s .c o m*/ * Converts the supplied string to CamelCase by converting the first character to upper case and the rest of the * string to lower case. * * @param str the input string * @return a string */ public static String toCamelCase(String str) { String firstLetter = str.substring(0, 1); String rest = str.substring(1); return firstLetter.toUpperCase() + rest.toLowerCase(); } }