Java String Proper Case toProperCase(final String s)

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

Description

Convert to "Proper case" ; capital first letter, lowercase suffix.

License

Apache License

Parameter

Parameter Description
s the String to convert to "ProperCase" .

Return

the String s converted to "ProperCase" .

Declaration

public static String toProperCase(final String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**// ww w. ja va2  s.c  o  m
     * Convert to {@literal "Proper case"}; capital first letter, lowercase suffix.
     *
     * @param s the {@code String} to convert to {@literal "ProperCase"}.
     * @return the {@code String s} converted to {@literal "ProperCase"}.
     */
    public static String toProperCase(final String s) {
        return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
    }
}

Related

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