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 upperFirstLetter(String s) {
        if (isEmpty(s) || !Character.isLowerCase(s.charAt(0)))
            return s;
        return String.valueOf((char) (s.charAt(0) - 32)) + s.substring(1);
    }

    public static boolean isEmpty(CharSequence s) {
        return s == null || s.length() == 0;
    }

    public static int length(CharSequence s) {
        return s == null ? 0 : s.length();
    }
}