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;

public class Main {
    public static Long toLong(String string) {
        return string == null ? null : Long.parseLong(string.trim());
    }//from w ww  .j  a v  a 2s  .  com

    public static String trim(String string, int maxLength) {
        if (string == null) {
            return null;
        }

        if (string.length() > maxLength) {
            return string.substring(0, maxLength);
        }

        return string;

    }
}

Related

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