Java String Capitalize Word capitalizeWord(String s)

Here you can find the source of capitalizeWord(String s)

Description

capitalize Word

License

Open Source License

Declaration

private static String capitalizeWord(String s) 

Method Source Code

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

public class Main {
    private static String capitalizeWord(String s) {
        if (s.length() > 1) {
            return s.substring(0, 1).toUpperCase() + s.substring(1, s.length()).toLowerCase();
        }/*from   w ww.  j ava2 s. c  om*/

        return s.toUpperCase();
    }
}

Related

  1. capitalizeFirsts(String word)
  2. capitalizeInitials(String words)
  3. capitalizeOneWord(String inputWord)
  4. capitalizeSingle(String word)
  5. capitalizeWord(String s)
  6. capitalizeWord(String str)
  7. capitalizeWord(String word)
  8. capitalizeWord(String word)
  9. capitalizeWord(String word)