Java String Upper Case toUpperCase(String source)

Here you can find the source of toUpperCase(String source)

Description

This method returns the upper case version of the source string.

License

Open Source License

Parameter

Parameter Description
source The source string.

Return

The upper case version of the string.

Declaration

public static String toUpperCase(String source) 

Method Source Code

//package com.java2s;
/**//  ww  w. ja  v  a2 s  . c o m
 * (c) 2008 Cordys R&D B.V. All rights reserved. The computer program(s) is the
 * proprietary information of Cordys B.V. and provided under the relevant
 * License Agreement containing restrictions on use and disclosure. Use is
 * subject to the License Agreement.
 */

public class Main {
    /**
     * This method returns the upper case version of the source string. This method could be used in
     * a BPM to accommodate the lack of this function in XPath 1.0
     *
     * @param   source  The source string.
     *
     * @return  The upper case version of the string.
     */
    public static String toUpperCase(String source) {
        String returnValue = "";

        if (isSet(source)) {
            returnValue = source.toUpperCase();
        }

        return returnValue;
    }

    /**
     * This method returns whether or not a string is filled.
     *
     * @param   source  The source to check.
     *
     * @return  true if the string is set. Otherwise false.
     */
    public static boolean isSet(String source) {
        return (source != null) && (source.trim().length() > 0);
    }
}

Related

  1. toUpperCase(String s)
  2. toUpperCase(String s)
  3. toUpperCase(String s)
  4. toUpperCase(String s)
  5. toUpperCase(String s, int start, int end)
  6. toUpperCase(String src)
  7. toUpperCase(String str)
  8. toUpperCase(String str)
  9. toUpperCase(String str)