Java Regex Number Validate isNumberOfShownValue(String inputString)

Here you can find the source of isNumberOfShownValue(String inputString)

Description

is Number Of Shown Value

License

Open Source License

Declaration

public static boolean isNumberOfShownValue(String inputString) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.util.regex.Pattern;

public class Main {
    public static boolean isNumberOfShownValue(String inputString) {

        String regex = "^[1-9]\\d*"; //$NON-NLS-1$
        return getCheckValue(regex, inputString);
    }//w w  w . j  ava 2s  .co m

    public static boolean getCheckValue(String regex, String inputString) {

        if (isEmpty(inputString)) {
            return false;
        }

        return Pattern.matches(regex, inputString);
    }

    /**
     * DOC Zqin Comment method "isEmpty".
     * 
     * @param strs
     * @return
     */
    public static boolean isEmpty(String... strs) {
        if (strs == null) {
            return false;
        }

        for (String str : strs) {
            if (str == null) {
                return true;
            } else if ("".equals(str.trim())) { //$NON-NLS-1$
                return true;
            }
        }

        return false;
    }
}

Related

  1. isNumber(String value)
  2. isNumber(String value)
  3. isNumber_Lowerletter_Underline(String str)
  4. isNumberForLength(String numStr, int length)
  5. isNumberLiteral(String s)
  6. isNumeric(String as_argument)
  7. isNumeric(String input)
  8. isNumeric(String number)
  9. isNumeric(String s)