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 toInitCap(String param) {

        if (param != null && param.length() > 0) {
            char[] charArray = param.toCharArray(); // convert into char array
            charArray[0] = Character.toUpperCase(charArray[0]); // set capital
            // letter to
            // first
            // postion
            return new String(charArray); // return desired output
        } else {
            return "";
        }
    }
}