Here you can find the source of toUpperCase(String str)
public static String toUpperCase(String str)
//package com.java2s; //License from project: LGPL public class Main { public static String toUpperCase(String str) { int len = str.length(); char c;//from w ww .j a va2s .co m for (int i = 0; i < len; i++) { c = str.charAt(i); if (!((c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'))) { return str.toUpperCase(); } } return str; } public static int length(String str) { if (str == null) return 0; return str.length(); } }