Java String Capitalize capitalize(String str)

Here you can find the source of capitalize(String str)

Description

capitalize

License

Apache License

Declaration

private static String capitalize(String str) 

Method Source Code

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

public class Main {
    private static String capitalize(String str) {
        String prefix = str.substring(0, 1).toUpperCase();
        String suffix = str.length() > 1 ? str.substring(1).toLowerCase() : "";
        return prefix + suffix;
    }/*from  w  ww .  j a  v  a 2 s  .c  om*/
}

Related

  1. capitalize(String str)
  2. capitalize(String str)
  3. capitalize(String str)
  4. capitalize(String str)
  5. capitalize(String str)
  6. capitalize(String str)
  7. capitalize(String str)
  8. capitalize(String str)
  9. capitalize(String str)