Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {

    public static long strTolong(String str) {
        try {
            return Long.parseLong(str, 10);
        } catch (Exception e) {
            return 0;
        }
    }

    public static Long parseLong(String str) {
        if (isEmpty1(str)) {
            return null;
        } else {
            return Long.parseLong(str);
        }
    }

    public static boolean isEmpty1(String str) {
        if (null == str) {
            return true;
        }
        return "".equals(str.trim());
    }
}