stringToInt

import java.util.regex.*;
public class Test1 {
	 
	 public static void main(String[] args) {
	
		new Test1().stringToInt("-1234567890123");
	 }
	 public static void stringToInt(String str)
	 {
		 
		 String reg="[+-]?\\d+";
		 Pattern p=Pattern.compile(reg);
		 Matcher m=p.matcher(str);
		 if(m.matches())
		 {
			 if((-2^31)

你可能感兴趣的:(stringToInt)