Here you can find the source of toUpperCase(String s)
public static String toUpperCase(String s)
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by public class Main { /**/*from w w w .ja v a2s .co m*/ * Locale-independent variant of {@link String#toUpperCase()}. * This method works on {@code char} level and hence uses a locale-independent * character mapping as defined by the Unicode standard. */ public static String toUpperCase(String s) { StringBuilder sb = new StringBuilder(s); for (int i = 0, len = sb.length(); i < len; i++) { char ch = sb.charAt(i); char ch2 = Character.toUpperCase(ch); if (ch != ch2) sb.setCharAt(i, ch2); } return sb.toString(); } }