Android String to Long Convert isLong(String str)

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

Description

is Long

Declaration

public static boolean isLong(String str) 

Method Source Code

//package com.java2s;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static boolean isLong(String str) {
        if ("0".equals(str.trim())) {
            return true;
        }/*  w w w . j a v  a2s .  co m*/
        Pattern pattern = Pattern.compile("^[^0]\\d*");
        Matcher isNum = pattern.matcher(str);
        if (!isNum.matches()) {
            return false;
        }
        return true;
    }
}

Related

  1. parseLong(String s)
  2. getLongValue(String value, Long defaultValue)
  3. toLong(String obj)
  4. getLongValue(String str)
  5. stringToListLong(String input)
  6. toLong(String value)
  7. toLong(String str, long defValue)