Here you can find the source of toUpperCase(String value)
Converts the given value to upper case.
Parameter | Description |
---|---|
value | The string value, may be null. |
public static String toUpperCase(String value)
//package com.java2s; //License from project: Apache License public class Main { /**//w w w. ja v a2 s . c o m * <p> * Converts the given value to upper case. * </p> * <p/> * <pre> * toUpperCase(null) = null * toUpperCase("") = "" * toUpperCase("aBc") = "ABC" * toUpperCase("ABC") = "ABC" * toUpperCase(" abc ") = "ABC" * </pre> * * @param value * The string value, may be null. * @return the given {@code value} converted to upper case or {@code null}. */ public static String toUpperCase(String value) { if (value == null) { return null; } return value.trim().toUpperCase(); } /** * Trims the given {@code value}. * * @param value * The value to trim. * @return the given {@code value} trimmed or {@code null}. */ public static String trim(String value) { if (value == null) { return null; } return value.trim(); } }