Java Regex Number Validate isNumString(String txt)

Here you can find the source of isNumString(String txt)

Description

is Num String

License

LGPL

Declaration

public static boolean isNumString(String txt) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.util.regex.Pattern;

public class Main {
    public static boolean isNumString(String txt) {
        return isEqualsFormat("^\\d+(,\\d+)*$", txt);
    }/*from  www.  j  a  v a  2  s  .c om*/

    public static boolean isEqualsFormat(String regex, String txt) {
        return txt != null && Pattern.matches(regex, txt);
    }
}

Related

  1. isNumeric(String str)
  2. isNumeric(String text)
  3. isNumeric(String value)
  4. isNumericAndCanNull(String src)
  5. isNumericAndCanNull(String src)
  6. parseNumber(String in)
  7. parseNumber(String input)
  8. parseNumber(String input)
  9. parseNumber(String s)