Here you can find the source of toUpperCase(String text)
public static String toUpperCase(String text)
//package com.java2s; //License from project: Open Source License public class Main { public static String toUpperCase(String text) { if (text != null) { int len = text.length(); if (len > 0) { char[] buf = new char[len]; for (int i = 0; i < len; i++) { buf[i] = Character.toUpperCase(text.charAt(i)); }//from w ww . ja v a 2 s .c o m text = new String(buf); } } return text; } }