Java String Capitalize capitalize(String token)

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

Description

capitalize

License

Open Source License

Declaration

public static String capitalize(String token) 

Method Source Code

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

public class Main {
    public static String capitalize(String token) {
        if (token.length() == 0)
            return "";
        char cap = Character.toUpperCase(token.charAt(0));
        if (token.length() == 1)
            return Character.toString(cap);
        return cap + token.substring(1);
    }//from  www .  ja  v a2 s.c om
}

Related

  1. capitalize(String text)
  2. capitalize(String text)
  3. capitalize(String text)
  4. capitalize(String texte)
  5. capitalize(String to_capitalize)
  6. Capitalize(String val)
  7. capitalize(String value)
  8. capitalize(String value)
  9. capitalize(String value)