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 cutLastChar(String str) {
        return (isEmpty(str)) ? str : str.substring(0, str.length() - 1);
    }

    public static boolean isEmpty(String s) {
        return null == s || "".equals(s);
    }

    public static boolean isEmpty(StringBuffer s) {
        return null == s || s.equals("");
    }
}