com.github.fosin.cdp.util.NumberUtil Maven / Gradle / Ivy
package com.github.fosin.cdp.util;
import java.util.regex.Pattern;
/**
* Description:
*
* @author fosin
* @date 2018.7.31
* @version $Id: $
*/
public class NumberUtil {
/*
* 判断是否为整数
* @param str 传入的字符串
* @return 是整数返回true,否则返回false
*/
/**
* isInteger
*
* @param str a {@link java.lang.String} object.
* @return a boolean.
*/
public static boolean isInteger(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy