Here you can find the source of toUpperCase(String str)
public static String toUpperCase(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String toUpperCase(String str) { StringBuffer buffer = new StringBuffer(str); for (int i = 0; i < buffer.length(); i++) { char c = buffer.charAt(i); buffer.setCharAt(i, Character.toUpperCase(c)); }/* w w w . j a va 2 s . c o m*/ return buffer.toString(); } public static String toString(Object obj) { StringBuffer buffer = new StringBuffer(); if (obj != null) { buffer.append(obj); } return buffer.toString(); } }