Java examples for java.lang:String Case
upper Case string and handle null value
import java.util.ArrayList; import java.util.List; public class Main{ public static void main(String[] argv){ String str = "java2s.com"; System.out.println(upperCase(str)); }//w w w.j av a 2s . c o m public static String upperCase(String str) { if (str == null) { return null; } return str.toUpperCase(); } }