Java String Upper Case toUpperCase(String str)

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

Description

to Upper Case

License

LGPL

Declaration

public static String toUpperCase(String str) 

Method Source Code

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

Related

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