Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {

    public static String replaceUpperCase(String str) {
        StringBuffer sb = new StringBuffer();
        String[] c = str.split("_");
        for (int i = 0; c != null && i < c.length; i++) {
            if (i > 0) {
                sb.append(c[i].substring(0, 1).toUpperCase() + c[i].substring(1));
            } else {
                sb.append(c[i]);
            }
        }
        return sb.toString();
    }
}