Java String to Long asLong(String str)

Here you can find the source of asLong(String str)

Description

as Long

License

Open Source License

Declaration

protected static long asLong(String str) 

Method Source Code

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

public class Main {
    protected static long asLong(String str) {
        if (str != null && str.length() > 0)
            try {
                return Long.parseLong(str.trim());
            } catch (Exception e) {
            }// w  ww  .  jav  a2  s . c  o  m
        return 0;
    }
}

Related

  1. asLong(String param)
  2. asLong(String str, long defaultValue)
  3. asLong(String string)
  4. asLong(String v)
  5. asLong(String value)