Here you can find the source of toProperCase(final String string)
Parameter | Description |
---|---|
string | i.e. string or stRiNg |
public static final synchronized String toProperCase(final String string)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j ava2s. c o m*/ * @param string i.e. string or stRiNg * @return ProperCase String */ public static final synchronized String toProperCase(final String string) { String lowerCase = string.toLowerCase(); lowerCase = lowerCase.substring(1); String firstCharacter = "" + string.charAt(0); firstCharacter = firstCharacter.toUpperCase(); return firstCharacter + lowerCase; } public static final synchronized String[] toLowerCase(final String[] strings) { String[] lowerCaseStrings = new String[strings.length]; for (int i = 0; i < strings.length; i++) { lowerCaseStrings[i] = strings[i].toLowerCase(); } return lowerCaseStrings; } }