Java String Proper Case toProperCase(final String string)

Here you can find the source of toProperCase(final String string)

Description

to Proper Case

License

Open Source License

Parameter

Parameter Description
string i.e. string or stRiNg

Return

ProperCase String

Declaration

public static final synchronized String toProperCase(final String string) 

Method Source Code

//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;
    }
}

Related

  1. toProperCase(final String s)
  2. toProperCase(String s)
  3. toProperCase(String s)
  4. toProperCase(String s)
  5. toProperCase(String s)