Here you can find the source of toUpperCase(String value)
Parameter | Description |
---|---|
value | - string to test |
public static String toUpperCase(String value)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w. ja v a 2s .c o m*/ * Returns upper-case string if a string is not null or if the trimmed value has a length of > 0. * * @param value - string to test * @return value - string in upperCase */ public static String toUpperCase(String value) { if (!isNullOrEmpty(value)) { value = value.toUpperCase(); } return value; } /** * Returns true if a string is null or if the trimmed value has a length of 0. * * @param value - string to test * @return - true it null or empty */ public static boolean isNullOrEmpty(String value) { boolean status = false; if (value == null) { status = true; } else if (value.trim().length() == 0) { status = true; } return status; } }