Java Regex Int Validate parseIntToString(String value)

Here you can find the source of parseIntToString(String value)

Description

parse Int To String

License

GNU General Public License

Declaration

public static String parseIntToString(String value) 

Method Source Code

//package com.java2s;
/*//from  w  w  w  . j  a  va  2  s . c o  m
 * This is the source code of Telegram for Android v. 2.x.x.
 * It is licensed under GNU GPL v. 2 or later.
 * You should have received a copy of the license in this archive (see LICENSE).
 *
 * Copyright Nikolai Kudashov, 2013-2015.
 */

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

public class Main {
    public static Pattern pattern = Pattern.compile("[0-9]+");

    public static String parseIntToString(String value) {
        Matcher matcher = pattern.matcher(value);
        if (matcher.find()) {
            return matcher.group(0);
        }
        return null;
    }
}

Related

  1. parseInteger(String inStr, Integer def)
  2. parseInteger(String key, String sourceString)
  3. parseInteger(String str)
  4. parseIntegerList(String var0, int var1, int var2)
  5. parseIntegers(String integerString)