Here you can find the source of toUpperCase(String[] list)
Parameter | Description |
---|---|
list | input list |
public static String[] toUpperCase(String[] list)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w . j av a 2 s. c om*/ * convert to uppercase. * * @param list input list * @return converted array */ public static String[] toUpperCase(String[] list) { if (isNullOrEmpty(list)) return list; String[] newList = new String[list.length]; for (int i = 0; i < list.length; i++) { newList[i] = list[i].toUpperCase(); } return newList; } /** * Returns true if the data is null or empty string. * * @param data data * @return boolean */ public static boolean isNullOrEmpty(String data) { return data == null || data.trim().length() == 0; } /** * Returns true if the data is null or empty string array (length == 0). * * @param data data * @return boolean */ public static boolean isNullOrEmpty(String[] data) { return data == null || data.length == 0; } }