is Double by regex - Java java.lang

Java examples for java.lang:double

Description

is Double by regex

Demo Code


//package com.java2s;
import java.util.regex.Pattern;

public class Main {
    public static boolean isDouble(Object value) {
        return Pattern.matches("-?\\\\d+(.\\\\d+)?", String.valueOf(value));
    }//www.ja  va  2 s  . c o  m
}

Related Tutorials