to Title Case by locale - Android java.lang

Android examples for java.lang:String Case

Description

to Title Case by locale

Demo Code

import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Locale;

public class Main{

    public static String toTitleCase(String s, Locale locale) {
        if (s.length() <= 1) {
            return s;
        }/*from   w  w  w  . j  av a 2s  . c  o m*/
        return s.toUpperCase(locale).charAt(0) + s.substring(1);
    }

}

Related Tutorials