Java string is determined whether or not the digital

str.matches("\\d+")

If the value is true

Integer.parseInt (str); it can be converted to a int

Guess you like

Origin www.cnblogs.com/jnhs/p/11639526.html