Java Long Number Create toLong(String string)

Here you can find the source of toLong(String string)

Description

to Long

License

Open Source License

Declaration

public static long toLong(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static long toLong(String string) {
        String str = trim(string);
        if ("".equals(str))
            str = "0";
        return Long.parseLong(str);
    }/*ww w.  j a  v a  2 s.c  om*/

    /**
     * trim
     * 
     * @param string
     * @return
     */
    public static String trim(String string) {
        if (string == null)
            return "";
        else
            return string.trim();
    }
}

Related

  1. toLong(String str)
  2. toLong(String str, long defaultValue)
  3. toLong(String str, long val)
  4. toLong(String string)
  5. toLong(String string)
  6. toLong(String string)
  7. toLong(String strVal)
  8. toLong(String time)
  9. toLong(String tStr)