Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Locale;

public class Main {
    private static String UpperCase(String str) {
        int len = str.length();
        String result = "";
        for (int i = 0; i < len; i++) {
            String subStr = str.substring(i, i + 1);
            char subChar = str.charAt(i);
            if (subChar >= 'a' && subChar <= 'z')
                result += subStr.toUpperCase(Locale.US);
            else
                result += subStr;
        }
        return result;
    }
}