Java String Proper Case toProperCase(String text)

Here you can find the source of toProperCase(String text)

Description

to Proper Case

License

Open Source License

Declaration

public static String toProperCase(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toProperCase(String text) {
        text = text.toLowerCase();/*from  w  w w.  ja v a2 s  .  co  m*/
        if (text.length() > 1) {
            text = text.substring(0, 1).toUpperCase() + text.substring(1).toLowerCase();
        } else {
            text = text.toUpperCase();
        }
        return text;
    }
}

Related

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