Android String to Long Convert convertStringToLong(String str, long failValue)

Here you can find the source of convertStringToLong(String str, long failValue)

Description

convert String To Long

Declaration

public static long convertStringToLong(String str, long failValue) 

Method Source Code

//package com.java2s;

public class Main {

    public static long convertStringToLong(String str, long failValue) {
        if (str == null) {
            return failValue;
        }//from ww  w  .jav  a2s. com
        try {
            return Long.parseLong(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return failValue;
    }
}

Related

  1. getLongValue(String str)
  2. stringToListLong(String input)
  3. toLong(String value)
  4. toLong(String str, long defValue)
  5. parseLong(String string, long defValue)
  6. stringToLong(String input)
  7. longsToString(long... longs)
  8. parseCSLongs(String s)
  9. parseLong(String s)