public class Number{
//java.lang.NumberFormatException: input string: ""数字格式异常
public static void main (String [] args){
String a=" 15";
//trim();去掉首位空格,replace(" ","")去掉所有空格
int b=Integer.parseInt(a.replace(" ",""));
System.out.println(b);
}
}