Java String Capitalize First capitalizeFirstLetter(String[] strArr)

Here you can find the source of capitalizeFirstLetter(String[] strArr)

Description

capitalize First Letter

License

Creative Commons License

Declaration

public static String[] capitalizeFirstLetter(String[] strArr) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public static String[] capitalizeFirstLetter(String[] strArr) {
        for (int j = 0; j < strArr.length; j++) {
            strArr[j] = capitalizeFirstLetter(strArr[j]);
        }//w  ww . j av  a  2  s.com
        return strArr;
    }

    public static String capitalizeFirstLetter(String word) {
        if (word.length() >= 2) {
            word = word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
        } else {
            word = word.toUpperCase();
        }
        return word;
    }
}

Related

  1. capitalizeFirstLetter(String str)
  2. capitalizeFirstLetter(String str)
  3. capitalizeFirstLetter(String string)
  4. capitalizeFirstLetter(String string)
  5. capitalizeFirstLetter(String text)
  6. capitalizeFirstOnly(String original)
  7. capitalizeFirstOnly(String s)
  8. capitalizeTheFirstLetter(String input)