Java String Upper Case toUpperCase(String str)

Here you can find the source of toUpperCase(String str)

Description

to Upper Case

License

Apache License

Declaration

public static String toUpperCase(String str) 

Method Source Code

//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();
    }
}

Related

  1. toUpperCase(String s)
  2. toUpperCase(String s, int start, int end)
  3. toUpperCase(String source)
  4. toUpperCase(String src)
  5. toUpperCase(String str)
  6. toUpperCase(String str)
  7. toUpperCase(String str)
  8. toUpperCase(String string)
  9. toUpperCase(String string)