Java String Capitalize capitalize(String string)

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

Description

capitalize

License

MIT License

Declaration

public static String capitalize(String string) 

Method Source Code

//package com.java2s;
/*//from   w  ww  .  ja  v a  2  s.  c  o  m
 * Copyright 2015 Workday, Inc.
 *
 * This software is available under the MIT license.
 * Please see the LICENSE.txt file in this project.
 */

public class Main {
    public static String capitalize(String string) {
        return isNotEmpty(string) ? string.substring(0, 1).toUpperCase() + string.substring(1) : string;
    }

    public static boolean isNotEmpty(CharSequence charSequence) {
        return charSequence != null && charSequence.length() > 0;
    }
}

Related

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